Systems and methods for applying deblocking filters to reconstructed video data

ABSTRACT

A video coding device may be configured to perform video coding according to one or more of the techniques described herein.

TECHNICAL FIELD

This disclosure relates to video coding and more particularly totechniques for performing deblocking of reconstructed video data.

BACKGROUND ART

Digital video capabilities can be incorporated into a wide range ofdevices, including digital televisions, laptop or desktop computers,tablet computers, digital recording devices, digital media players,video gaming devices, cellular telephones, including so-calledsmartphones, medical imaging devices, and the like. Digital video may becoded according to a video coding standard. Video coding standards mayincorporate video compression techniques. Examples of video codingstandards include ISO/IEC MPEG-4 Visual and ITU-T H.264 (also known asISO/IEC MPEG-4 AVC) and High-Efficiency Video Coding (HEVC). HEVC isdescribed in High Efficiency Video Coding (HEVC), Rec. ITU-T H.265,December 2016, which is incorporated by reference, and referred toherein as ITU-T H.265. Extensions and improvements for ITU-T H.265 arecurrently being considered for the development of next generation videocoding standards. For example, the ITU-T Video Coding Experts Group(VCEG) and ISO/IEC (Moving Picture Experts Group (MPEG) (collectivelyreferred to as the Joint Video Exploration Team (JVET)) are studying thepotential need for standardization of future video coding technologywith a compression capability that significantly exceeds that of thecurrent HEVC standard. The Joint Exploration Model 7 (JEM 7), AlgorithmDescription of Joint Exploration Test Model 7 (JEM 7), ISO/IECJTC1/SC29/WG11 Document: JVET-G1001, July 2017, Torino, I T, which isincorporated by reference herein, describes the coding features that areunder coordinated test model study by the JVET as potentially enhancingvideo coding technology beyond the capabilities of ITU-T H.265. Itshould be noted that the coding features of JEM 7 are implemented in JEMreference software. As used herein, the term JEM may collectively referto algorithms included in JEM 7 and implementations of JEM referencesoftware.

Video compression techniques reduce data requirements for storing andtransmitting video data by exploiting the inherent redundancies in avideo sequence. Video compression techniques may sub-divide a videosequence into successively smaller portions (i.e., groups of frameswithin a video sequence, a frame within a group of frames, slices withina frame, coding tree units (e.g., macroblocks) within a slice, codingblocks within a coding tree unit, etc.). Intra prediction codingtechniques (e.g., intra-picture (spatial)) and inter predictiontechniques (i.e., inter-picture (temporal)) may be used to generatedifference values between a unit of video data to be coded and areference unit of video data. The difference values may be referred toas residual data. Residual data may be coded as quantized transformcoefficients. Syntax elements may relate residual data and a referencecoding unit (e.g., intra-prediction mode indices, motion vectors, andblock vectors). Residual data and syntax elements may be entropy coded.Entropy encoded residual data and syntax elements may be included in acompliant bitstream. Compliant bitstreams and associated metadata may beformatted according to data structures.

SUMMARY OF INVENTION

In one example, a method of filtering reconstructed video data, themethod comprising: receiving an edge type variable specifying whether avertical or a horizontal edge is filtered; deriving a maximum filterlength based on the edge type variable; and performing a deblockingfiltering for a current block based on the maximum filter length.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a conceptual diagram illustrating an example of a group ofpictures coded according to a quad tree binary tree partitioning inaccordance with one or more techniques of this disclosure.

FIG. 2 is a conceptual diagram illustrating an example of a videocomponent sampling format in accordance with one or more techniques ofthis disclosure.

FIG. 3 is a conceptual diagram illustrating possible coding structuresfor a block of video data in accordance with one or more techniques ofthis disclosure.

FIG. 4A is a conceptual diagram illustrating example of coding a blockof video data in accordance with one or more techniques of thisdisclosure.

FIG. 4B is a conceptual diagram illustrating example of coding a blockof video data in accordance with one or more techniques of thisdisclosure.

FIG. 5A is a conceptual diagram illustrating block of video dataincluding a deblocking boundary in accordance with one or moretechniques of this disclosure.

FIG. 5B is a conceptual diagram illustrating block of video dataincluding a deblocking boundary in accordance with one or moretechniques of this disclosure.

FIG. 6A is an example of a table that may be used to determinedeblocking parameters in accordance with one or more techniques of thisdisclosure.

FIG. 6B is an example of a table that may be used to determinedeblocking parameters in accordance with one or more techniques of thisdisclosure.

FIG. 7 is a block diagram illustrating an example of a system that maybe configured to encode and decode video data according to one or moretechniques of this disclosure.

FIG. 8 is a block diagram illustrating an example of a video encoderthat may be configured to encode video data according to one or moretechniques of this disclosure.

FIG. 9 is a block diagram illustrating an example of a video decoderthat may be configured to decode video data according to one or moretechniques of this disclosure.

FIG. 10 is a flowchart illustrating an example of performing deblockingaccording to one or more techniques of this disclosure.

FIG. 11 is a flowchart illustrating an example of performing deblockingaccording to one or more techniques of this disclosure.

FIG. 12 is a flowchart illustrating an example of performing deblockingaccording to one or more techniques of this disclosure.

FIG. 13 is an example of a table that may be used to determinedeblocking parameters in accordance with one or more techniques of thisdisclosure.

FIG. 14A is a conceptual diagram illustrating block of video dataincluding a deblocking boundary in accordance with one or moretechniques of this disclosure.

FIG. 14B a conceptual diagram illustrating block of video data includinga deblocking boundary in accordance with one or more techniques of thisdisclosure.

DESCRIPTION OF EMBODIMENTS

In general, this disclosure describes various techniques for codingvideo data. In particular, this disclosure describes techniques forperforming deblocking of reconstructed video data. It should be notedthat although techniques of this disclosure are described with respectto ITU-T H.264, ITU-T H.265, and JEM, the techniques of this disclosureare generally applicable to video coding. For example, the codingtechniques described herein may be incorporated into video codingsystems, (including video coding systems based on future video codingstandards) including block structures, intra prediction techniques,inter prediction techniques, transform techniques, filtering techniques,and/or entropy coding techniques other than those included in ITU-TH.265. Thus, reference to ITU-T H.264, ITU-T H.265 and JEM is fordescriptive purposes and should not be construed to limit the scope ofthe techniques described herein. Further, it should be noted thatincorporation by reference of documents herein should not be construedto limit or create ambiguity with respect to terms used herein. Forexample, in the case where an incorporated reference provides adifferent definition of a term than another incorporated referenceand/or as the term is used herein, the term should be interpreted in amanner that broadly includes each respective definition and/or in amanner that includes each of the particular definitions in thealternative.

In one example, a method of filtering reconstructed video data comprisesreceiving an array of sample values including adjacent reconstructedvideo blocks for a component of video data, and modifying sample valuesin the adjacent reconstructed video blocks according to multiple passesof a deblocking filter.

In one example, a device for video coding comprises one or moreprocessors configured to receive an array of sample values includingadjacent reconstructed video blocks for a component of video data, andmodify sample values in the adjacent reconstructed video blocksaccording to multiple passes of a deblocking filter.

In one example, a non-transitory computer-readable storage mediumcomprises instructions stored thereon that, when executed, cause one ormore processors of a device to receive an array of sample valuesincluding adjacent reconstructed video blocks for a component of videodata, and modify sample values in the adjacent reconstructed videoblocks according to multiple passes of a deblocking filter.

In one example, an apparatus comprises means for receiving an array ofsample values including adjacent reconstructed video blocks for acomponent of video data, and means for modifying sample values in theadjacent reconstructed video blocks according to multiple passes of adeblocking filter.

The details of one or more examples are set forth in the accompanyingdrawings and the description below. Other features, objects, andadvantages will be apparent from the description and drawings, and fromthe claims.

Video content typically includes video sequences comprised of a seriesof frames. A series of frames may also be referred to as a group ofpictures (GOP). Each video frame or picture may include a plurality ofslices or tiles, where a slice or tile includes a plurality of videoblocks. As used herein, the term video block may generally refer to anarea of a picture or may more specifically refer to the largest array ofsample values that may be predictively coded, sub-divisions thereof,and/or corresponding structures. Further, the term current video blockmay refer to an area of a picture being encoded or decoded. A videoblock may be defined as an array of sample values that may bepredictively coded. It should be noted that in some cases pixel valuesmay be described as including sample values of respective components ofvideo data, which may also be referred to as color components, (e.g.,luma (Y) and chroma (Cb and Cr) components or red, green, and bluecomponents). It should be noted that in some cases, the terms pixelvalues and sample values are used interchangeably. Video blocks may beordered within a picture according to a scan pattern (e.g., a rasterscan). A video encoder may perform predictive encoding on video blocksand sub-divisions thereof. Video blocks and sub-divisions thereof may bereferred to as nodes.

ITU-T H.264 specifies a macroblock structure including 16×16 lumasamples. That is, in ITU-T H.264, a picture is segmented intomacroblocks. ITU-T H.265 specifies an analogous Coding Tree Unit (CTU)structure, which may also be referred to as a largest coding unit (LCU).In ITU-T H.265, pictures are segmented into CTUs. In ITU-T H.265, for apicture, a CTU size may be set as including 16×16, 32×32, or 64×64 lumasamples. In ITU-T H.265, a CTU is composed of respective Coding TreeBlocks (CTB) for each component of video data (e.g., luma (Y) and chroma(Cb and Cr)). Further, in ITU-T H.265, a CTU may be partitionedaccording to a quadtree (QT) partitioning structure, which results inthe CTBs of the CTU being partitioned into Coding Blocks (CB). That is,in ITU-T H.265, a CTU may be partitioned into quadtree leaf nodes.According to ITU-T H.265, one luma CB together with two correspondingchroma CBs and associated syntax elements are referred to as a codingunit (CU). In ITU-T H.265, a minimum allowed size of a CB may besignaled. In ITU-T H.265, the smallest minimum allowed size of a luma CBis 8×8 luma samples. In ITU-T H.265, the decision to code a picture areausing intra prediction or inter prediction is made at the CU level.

In ITU-T H.265, a CU is associated with a prediction unit (PU) structurehaving its root at the CU. In ITU-T H.265, PU structures allow luma andchroma CBs to be split for purposes of generating correspondingreference samples. That is, in ITU-T H.265, luma and chroma CBs may besplit into respect luma and chroma prediction blocks (PBs), where a PBincludes a block of sample values for which the same prediction isapplied. In ITU-T H.265, a CB may be partitioned into 1, 2, or 4 PBs.ITU-T H.265 supports PB sizes from 64×64 samples down to 4×4 samples. InITU-T H.265, square PBs are supported for intra prediction, where a CBmay form the PB or the CB may be split into four square PBs (i.e., intraprediction PB size types include M×M or M/2×M/2, where M is the heightand width of the square CB). In ITU-T H.265, in addition to the squarePBs, rectangular PBs are supported for inter prediction, where a CB mayby halved vertically or horizontally to form PBs (i.e., inter predictionPB types include M×M, M/2×M/2, M/2×M, or M×M/2). Further, it should benoted that in ITU-T H.265, for inter prediction, four asymmetric PBpartitions are supported, where the CB is partitioned into two PBs atone quarter of the height (at the top or the bottom) or width (at theleft or the right) of the CB (i.e., asymmetric partitions include M/4×Mleft, M/4×M right, M×M/4 top, and M×M/4 bottom). Intra prediction data(e.g., intra prediction mode syntax elements) or inter prediction data(e.g., motion data syntax elements) corresponding to a PB is used toproduce reference and/or predicted sample values for the PB.

JEM specifies a CTU having a maximum size of 256×256 luma samples. JEMspecifies a quadtree plus binary tree (QTBT) block structure. In JEM,the QTBT structure enables quadtree leaf nodes to be further partitionedby a binary tree (BT) structure. That is, in JEM, the binary treestructure enables quadtree leaf nodes to be recursively dividedvertically or horizontally. FIG. 1 illustrates an example of a CTU(e.g., a CTU having a size of 256×256 luma samples) being partitionedinto quadtree leaf nodes and quadtree leaf nodes being furtherpartitioned according to a binary tree. That is, in FIG. 1 dashed linesindicate additional binary tree partitions in a quadtree. Thus, thebinary tree structure in JEM enables square and rectangular leaf nodes,where each leaf node includes a CB. As illustrated in FIG. 1, a pictureincluded in a GOP may include slices, where each slice includes asequence of CTUs and each CTU may be partitioned according to a QTBTstructure. FIG. 1 illustrates an example of QTBT partitioning for oneCTU included in a slice. Thus, the binary tree structure in JEM enablessquare and rectangular leaf nodes, where each leaf node includes a CB.In JEM, CBs are used for prediction without any further partitioning.That is, in JEM, a CB may be a block of sample values on which the sameprediction is applied. Thus, a JEM QTBT leaf node may be analogous a PBin ITU-T H.265.

A video sampling format, which may also be referred to as a chromaformat, may define the number of chroma samples included in a CU withrespect to the number of luma samples included in a CU. For example, forthe 4:2:0 sampling format, the sampling rate for the luma component istwice that of the chroma components for both the horizontal and verticaldirections. As a result, for a CU formatted according to the 4:2:0format, the width and height of an array of samples for the lumacomponent are twice that of each array of samples for the chromacomponents. FIG. 2 is a conceptual diagram illustrating an example of acoding unit formatted according to a 4:2:0 sample format. FIG. 2illustrates the relative position of chroma samples with respect to lumasamples within a CU. As described above, a CU is typically definedaccording to the number of horizontal and vertical luma samples. Thus,as illustrated in FIG. 2, a 16×16 CU formatted according to the 4:2:0sample format includes 16×16 samples of luma components and 8×8 samplesfor each chroma component. Further, in the example illustrated in FIG.2, the relative position of chroma samples with respect to luma samplesfor video blocks neighboring the 16×16 CU are illustrated. For a CUformatted according to the 4:2:2 format, the width of an array ofsamples for the luma component is twice that of the width of an array ofsamples for each chroma component, but the height of the array ofsamples for the luma component is equal to the height of an array ofsamples for each chroma component. Further, for a CU formatted accordingto the 4:4:4 format, an array of samples for the luma component has thesame width and height as an array of samples for each chroma component.

As described above, intra prediction data or inter prediction data isused to produce reference sample values for a block of sample values.The difference between sample values included in a current PB, oranother type of picture area structure, and associated reference samples(e.g., those generated using a prediction) may be referred to asresidual data. Residual data may include respective arrays of differencevalues corresponding to each component of video data. Residual data maybe in the pixel domain. A transform, such as, a discrete cosinetransform (DCT), a discrete sine transform (DST), an integer transform,a wavelet transform, or a conceptually similar transform, may be appliedto an array of difference values to generate transform coefficients. Itshould be noted that in ITU-T H.265, a CU is associated with a transformunit (TU) structure having its root at the CU level. That is, in ITU-TH.265, an array of difference values may be sub-divided for purposes ofgenerating transform coefficients (e.g., four 8×8 transforms may beapplied to a 16×16 array of residual values). For each component ofvideo data, such sub-divisions of difference values may be referred toas Transform Blocks (TBs). It should be noted that in ITU-T H.265, TBsare not necessarily aligned with PBs. FIG. 3 illustrates examples ofalternative PB and TB combinations that may be used for coding aparticular CB. Further, it should be noted that in ITU-T H.265, TBs mayhave the following sizes 4×4, 8×8, 16×16, and 32×32. In JEM, residualvalues corresponding to a CB are used to generate transform coefficientswithout further partitioning. That is, in JEM a QTBT leaf node may beanalogous to both a PB and a TB in ITU-T H.265. It should be noted thatin JEM, a core transform and a subsequent secondary transforms may beapplied (in the video encoder) to generate transform coefficients. For avideo decoder, the order of transforms is reversed. Further, in JEM,whether a secondary transform is applied to generate transformcoefficients may be dependent on a prediction mode.

Transform coefficients may be quantized according to a quantizationprocess. Quantization approximates transform coefficients by amplitudesrestricted to a set of specified values. Quantization may be used inorder to vary the amount of data required to represent a group oftransform coefficients. Quantization may be generally described as beingrealized through division of transform coefficients by a scaling factorand any associated rounding functions (e.g., rounding to the nearestinteger). Thus, inverse quantization (or “dequantization”) may includemultiplication of coefficient level values by the scaling factor. Itshould be noted that as used herein the term quantization process insome instances may generally refer to division by a scaling factor togenerate level values or multiplication by a scaling factor to recovertransform coefficients in some instances. That is, a quantizationprocess may refer to quantization in some cases and inverse quantizationin some cases. A current block of video data is reconstructed byperforming inverse quantization on level values, performing an inversetransform, and adding a set of prediction values to the resultingresidual. The sample values of the reconstructed block may differ fromthe sample values of the current video block that were input into anencoding process. In this manner, coding may be said to be lossy.However, it should be noted that the difference in sample values may beconsidered acceptable to a viewer of the reconstructed video.

Quantized transform coefficients (which may be referred to as levelvalues) may be entropy coded according to an entropy encoding technique(e.g., content adaptive variable length coding (CAVLC), context adaptivebinary arithmetic coding (CABAC), probability interval partitioningentropy coding (PIPE), etc.). Further, syntax elements, such as, asyntax element indicating a prediction mode, may also be entropy coded.Entropy encoded quantized transform coefficients and correspondingentropy encoded syntax elements may form a compliant bitstream that canbe used to reproduce video data. A binarization process may be performedon syntax elements as part of an entropy coding process. Binarizationrefers to the process of converting a syntax value into a series of oneor more bits. These bits may be referred to as “bins.”FIGS. 4A-4B areconceptual diagrams illustrating examples of coding a block of videodata. As illustrated in FIG. 4A, a current block of video data (e.g., aCB corresponding to a video component) is encoded by generating aresidual by subtracting a set of prediction values from the currentblock of video data, performing a transformation on the residual, andquantizing the transform coefficients to generate level values. Asillustrated in FIG. 4B, the current block of video data is decoded byperforming inverse quantization on level values, performing an inversetransform, and adding a set of prediction values to the resultingresidual. It should be noted that in the examples in FIGS. 4A-4B, thesample values of the reconstructed block differs from the sample valuesof the current video block that is encoded. In this manner, coding maysaid to be lossy. However, the difference in sample values may beconsidered acceptable or imperceptible to a viewer of the reconstructedvideo.

As illustrated in FIG. 4A, quantized transform coefficients are codedinto a bitstream. Quantized transform coefficients and syntax elements(e.g., syntax elements indicating a coding structure for a video block)may be entropy coded according to an entropy coding technique. Examplesof entropy coding techniques include content adaptive variable lengthcoding (CAVLC), context adaptive binary arithmetic coding (CABAC),probability interval partitioning entropy coding (PIPE), and the like.Entropy encoded quantized transform coefficients and correspondingentropy encoded syntax elements may form a compliant bitstream that canbe used to reproduce video data at a video decoder. An entropy codingprocess may include performing a binarization on syntax elements.Binarization refers to the process of converting a value of a syntaxvalue into a series of one or more bits. These bits may be referred toas “bins.” Binarization is a lossless process and may include one or acombination of the following coding techniques: fixed length coding,unary coding, truncated unary coding, truncated Rice coding, Golombcoding, k-th order exponential Golomb coding, and Golomb-Rice coding.For example, binarization may include representing the integer value of5 for a syntax element as 00000101 using an 8-bit fixed lengthbinarization technique or representing the integer value of 5 as 11110using a unary coding binarization technique. As used herein each of theterms fixed length coding, unary coding, truncated unary coding,truncated Rice coding, Golomb coding, k-th order exponential Golombcoding, and Golomb-Rice coding may refer to general implementations ofthese techniques and/or more specific implementations of these codingtechniques. For example, a Golomb-Rice coding implementation may bespecifically defined according to a video coding standard, for example,ITU-T H.265. An entropy coding process further includes coding binvalues using lossless data compression algorithms. In the example of aCABAC, for a particular bin, a context model may be selected from a setof available context models associated with the bin. In some examples, acontext model may be selected based on a previous bin and/or values ofprevious syntax elements. A context model may identify the probabilityof a bin having a particular value. For instance, a context model mayindicate a 0.7 probability of coding a 0-valued bin and a 0.3probability of coding a 1-valued bin. It should be noted that in somecases the probability of coding a 0-valued bin and probability of codinga 1-valued bin may not sum to 1. After selecting an available contextmodel, a CABAC entropy encoder may arithmetically code a bin based onthe identified context model. The context model may be updated based onthe value of a coded bin. The context model may be updated based on anassociated variable stored with the context, e.g., adaptation windowsize, number of bins coded using the context. It should be noted, thataccording to ITU-T H.265, a CABAC entropy encoder may be implemented,such that some syntax elements may be entropy encoded using arithmeticencoding without the usage of an explicitly assigned context model, suchcoding may be referred to as bypass coding.

As described above, intra prediction data or inter prediction data mayassociate an area of a picture (e.g., a PB or a CB) with correspondingreference samples. For intra prediction coding, an intra prediction modemay specify the location of reference samples within a picture. In ITU-TH.265, defined possible intra prediction modes include a planar (i.e.,surface fitting) prediction mode (predMode: 0), a DC (i.e., flat overallaveraging) prediction mode (predMode: 1), and 33 angular predictionmodes (predMode: 2-34). In JEM, defined possible intra-prediction modesinclude a planar prediction mode (predMode: 0), a DC prediction mode(predMode: 1), and 65 angular prediction modes (predMode: 2-66). Itshould be noted that planar and DC prediction modes may be referred toas non-directional prediction modes and that angular prediction modesmay be referred to as directional prediction modes. It should be notedthat the techniques described herein may be generally applicableregardless of the number of defined possible prediction modes.

For inter prediction coding, a motion vector (MV) identifies referencesamples in a picture other than the picture of a video block to be codedand thereby exploits temporal redundancy in video. For example, acurrent video block may be predicted from reference block(s) located inpreviously coded frame(s) and a motion vector may be used to indicatethe location of the reference block. A motion vector and associated datamay describe, for example, a horizontal component of the motion vector,a vertical component of the motion vector, a resolution for the motionvector (e.g., one-quarter pixel precision, one-half pixel precision,one-pixel precision, two-pixel precision, four-pixel precision), aprediction direction and/or a reference picture index value. Further, acoding standard, such as, for example ITU-T H.265, may support motionvector prediction. Motion vector prediction enables a motion vector tobe specified using motion vectors of neighboring blocks. Examples ofmotion vector prediction include advanced motion vector prediction(AMVP), temporal motion vector prediction (TMVP), so-called “merge”mode, and “skip” and “direct” motion inference. Further, JEM supportsadvanced temporal motion vector prediction (ATMVP), Spatial-temporalmotion vector prediction (STMVP), Pattern matched motion vectorderivation (PMMVD) mode, which is a special merge mode based onFrame-Rate Up Conversion (FRUC) techniques, and affine transform motioncompensation prediction techniques.

As described above, quantization may be realized through division oftransform coefficients by a scaling factor and further may be used inorder to vary the amount of data required to represent a group oftransform coefficients. That is, increasing the scaling factor (ordegree of quantization) reduces the amount of data required to representa group coefficients. In ITU-T H.265, the degree of quantization may bedetermined by a quantization parameter, QP. In ITU-T H.265, for abit-depth of 8-bits, the QP can take 52 values from 0 to 51 and a changeof 1 for QP generally corresponds to a change in the value of thequantization scaling factor by approximately 12%. It should be notedthat more generally, in ITU-T H.265, the valid range of QP values for asource bit-depth is: −6*(bitdepth−8) to +51 (inclusive). Thus, forexample, in the case where the bit-depth is 10-bits, QP can take 64values from −12 to 51, which may be mapped to values 0 to 63 duringdequantization. In ITU-T H.265, a quantization parameter may be updatedfor each CU and a respective quantization parameter may be derived foreach of luma and chroma components. It should be noted that as thedegree of quantization increases (e.g., transform coefficients aredivided by a larger scaling factor value), the amount of distortion maybe increased (e.g., reconstructed video data may appear more “blocky” toa user).

In some cases, blocking artifacts may cause coding block boundaries ofreconstructed video data to be visually perceptible to a user. In orderto reduce blocking artifacts, reconstructed sample values may bemodified to minimize artifacts introduced by the video coding process.Such modifications may generally be referred to as filtering. It shouldbe noted that filtering may occur as part of an in-loop filteringprocess or a post-loop filtering process. For an in-loop filteringprocess, the resulting sample values of a filtering process may be usedfor predictive video blocks (e.g., stored to a reference frame bufferfor subsequent encoding at a video encoder and subsequent decoding at avideo decoder). For a post-loop filtering process the resulting samplevalues of a filtering process are merely output as part of the decodingprocess (e.g., not used for subsequent coding). For example, for anin-loop filtering process, the sample values resulting from filtering areconstructed block would be used for subsequent decoding (e.g., storedto a reference buffer) and would be output (e.g., to a display). For apost-loop filtering process, the reconstructed block withoutmodification would be used for subsequent decoding and the sample valuesresulting from filtering the reconstructed block would be output.

With respect to the equations used herein, the following arithmeticoperators may be used:

$\begin{matrix} + & {Addition} \\ - & {Subtraction} \\* & {{Multiplication},{{including}\mspace{14mu}{matrix}\mspace{14mu}{multiplication}}} \\/ & {{{Integer}\mspace{14mu}{division}\mspace{14mu}{with}\mspace{14mu}{truncation}\mspace{14mu}{of}\mspace{14mu}{the}\mspace{14mu}{result}\mspace{14mu}{toward}}\mspace{14mu}} \\\; & {{{{zero}.\mspace{14mu}{For}}\mspace{14mu}{example}},{{{7/4}\mspace{14mu}{and}}\mspace{14mu} - {{7/{- 4}}\mspace{14mu}{are}\mspace{14mu}{truncated}\mspace{14mu}{to}\mspace{14mu} 1}}} \\\; & {{and}\mspace{14mu} - {{7/4}\mspace{14mu}{and}\mspace{14mu}{7/{- 4}}\mspace{14mu}{are}\mspace{14mu}{truncated}\mspace{14mu}{to}}\mspace{14mu} - 1.} \\{\sum\limits_{i = x}^{y}{f(i)}} & {{The}\mspace{14mu}{summation}\mspace{14mu}{of}\mspace{14mu}{f(i)}\mspace{14mu}{with}\mspace{14mu} i\mspace{14mu}{taking}\mspace{14mu}{all}\mspace{14mu}{integer}\mspace{14mu}{values}} \\\; & {{from}\mspace{14mu} x\mspace{14mu}{up}\mspace{14mu}{to}\mspace{14mu}{and}\mspace{14mu}{including}\mspace{14mu}{y.}}\end{matrix}$

Further, the following mathematical functions may be used:

${{Clip}\; 3\left( {x,y,z} \right)} = \left\{ \begin{matrix}{x;} & {z < x} \\{y;} & {z > y} \\{z;} & {otherwise}\end{matrix} \right.$

-   -   Clip1c(x)=Clip3(0, (1<<BitDepthc)−1, x), where is BitDepthc        bitdepth of chroma channel    -   abs(x) is the absolute value of x.

${{Max}\left( {x,y} \right)} = \left\{ \begin{matrix}{x;} & {x>=y} \\{y;} & {x < y}\end{matrix} \right.$

Further, the following definitions of logical operators may be applied:

-   -   x && y Boolean logical “and” of x and y    -   x∥y Boolean logical “or” of x and y    -   ! Boolean logical “not”    -   x?y:z If x is TRUE or not equal to 0, evaluates to the value of        y; otherwise, evaluates to the value of z.

Further, the following relational operators may be applied:

-   -   > Greater than    -   >= Greater than or equal to    -   < Less than    -   <= Less than or equal to    -   == Equal to    -   != Not equal to

Further, the following bit-wise operators may be applied:

-   -   x>>y Arithmetic right shift of a two's complement integer        representation of x by y binary digits. This function is defined        only for non-negative integer values of y. Bits shifted into the        most significant bits (MSBs) as a result of the right shift have        a value equal to the MSB of x prior to the shift operation.    -   x<<y Arithmetic left shift of a two's complement integer        representation of x by y binary digits. This function is defined        only for non-negative integer values of y. Bits shifted into the        least significant bits (LSBs) as a result of the left shift have        a value equal to 0.

Deblocking (or de-blocking), deblock filtering, performing deblocking,or applying a deblocking filter refers to the process of smoothing videoblock boundaries with neighboring reconstructed video blocks (i.e.,making boundaries less perceptible to a viewer). Smoothing theboundaries of neighboring reconstructed video blocks may includemodifying sample values included in rows or columns adjacent to aboundary. ITU-T H.265 provides where a deblocking filter is applied toreconstructed sample values as part of an in-loop filtering process.ITU-T H.265 includes two types deblocking filters that may be used formodifying luma samples: a Strong Filter which modifies sample values inthe three adjacent rows or columns to a boundary and a Weak Filter whichmodifies sample values in the immediately adjacent row or column to aboundary and conditionally modifies sample values in the second row orcolumn from the boundary. Further, ITU-T H.265 includes one type offilter that may be used for modifying chroma samples, i.e., a NormalFilter.

FIGS. 5A-5B illustrate sample values included in video blocks P and Qhaving a boundary. As used herein, video blocks P and Q are used torefer to adjacent video blocks having a block boundary at whichdeblocking may be applied. The manner in which sample values aremodified may be based on defined filters, where p_(i) and q_(i)represent respective sample values in a column for a vertical boundaryand sample values in a row for a horizontal boundary and p_(i)′ andq_(i)′ represent modified sample values. Defined filters may definesamples that are to be modified (or filtered) and samples that are usedto determine how samples are to be modified. For example, as illustratedin FIG. 5A, in one example, samples values in each of the first threecolumns adjacent to the deblocking boundary may be modified (illustratedas filtered samples) based on sample values includes in the each of thefirst four columns adjacent to the deblocking boundary (illustrated assupport samples).

As described above, ITU-T H.265 includes two types of filters that maybe used for modifying luma samples: a Strong Filter and a Weak Filter.Simplified definitions of the Strong Filter and Weak Filter equationsfor modifying luma sample values are provided below. The definitions aresimplified in that they do not include clipping operations provided inITU-T H.265 (i.e., in ITU-T H.265, filtered values are clipped based ona value t_(C), described below), however, reference is made to Section8.7.2.5.7 of ITU-T H.265, which provides the complete definitions.

Strong Filter

p ₀′=(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)/8

p ₁′=(p ₂ +p ₁ +p ₀ +q ₀+2)/4

p ₂′=(2*p ₃+3*p ₂ +p ₁ +p ₀ +q ₀+4)/8

q ₀′=(p ₁+2*p ₀+2*q ₀+2*q ₁ +q ₂+4)/8

q ₁′=(p ₀ +q ₀ +q ₁ +q ₂+2)/4

q ₂′=(p ₀ +q ₀ +q ₁+3*q ₂+2*q ₃+4)/8

Weak Filter

Δ=(9*(q ₀ −p ₀)−3*(q ₁ −p ₁)+8)/16

p ₀ ′=p ₀+Δ

q ₀ ′=q ₀−Δ

-   -   Where p₁ and q₁ are conditionally modified, as described below,        as follows

Δp=((p ₂ +p ₀+1)/2−p ₁+Δ)/2

Δq=((q ₂ +p ₀+1)/2−q ₁−Δ)/2

p ₁ ′=p ₁ +Δp

q ₁ ′=q ₁ +Δq

Further, ITU-T H.265 includes one type of filter that may be used formodifying chroma samples: Normal Filter. Simplified definitions for theNormal Filter equations for modifying chroma sample values are providedbelow.

Normal Filter

Δ=((q ₀ −p ₀)*4+p ₁ −q ₁+4)/8

p ₀ ′=p ₀+Δ

q ₀ ′=q ₀−Δ

Deblocking may be performed based on a deblocking granularity. ITU-TH.265 provides an 8×8 deblocking granularity. That is, in ITU-T H.265for an area of a picture, each edge lying on the 8×8 grid is evaluatedto determine if a boundary exists. Further, in ITU-T H.265, a boundarystrength (Bs) is determined for each boundary. In ITU-T H.265, Bs isdetermined as one of 0, 1, or 2 as follows:

-   -   P and Q are two adjacent coding blocks then the filter strength        Bs is specified as:        -   If one of the blocks (P or Q) has an intra prediction mode,            then Bs=2;            -   Else if P and Q belong to different TBs and P or Q has                at least one non-zero            -   transform coefficient, then Bs=1;            -   Else if the reference pictures of P and Q are not equal,                then Bs=1;            -   Else if the difference between x or y motion vector                component of P and    -   Q is equal or greater than one integer sample, then Bs=1;        -   Else, Bs=0.

In ITU-T H.265, based on the QP used for coding the CBs including videoblocks P and Q (which may be referred to as QP_(P) and QP_(Q)),variables t_(C)′ and β′ are determined. FIG. 6A provides a table fordetermining t_(C)′ and β′. In ITU-T H.265, the index Q is determined asfollows:

For Luma:

-   -   For β′;

Q=Clip3(0,51,qP _(L)+(slice_beta_offset_div 2<<1))

-   -   For t_(c)′

Q=Clip3(0,53,qP _(L)+2*(bS−1)+(slice_tc_offset_div 2<<1)),

-   -   where,

qP _(L)=(QP _(Q) +QP _(P)+1)/2;

-   -   slice_beta_offset_div 2 is an offset value that applies to the        slice of video data that includes sample q_(0,0); and        slice_tc_offset_div 2 is an offset value that applies to the        slice of video data that includes sample q_(0,0).

ITU-T H.265, variables β and t_(C) are derived as follows:

β=β′*(1<<(BitDepth_(Y)−8))

t _(C) =t _(C)′*(1<<(BitDepth_(Y)−8))

-   -   where, BitDepth_(Y) specifies the bit depth of luma samples.

ITU-T H.265, defines a variable d, where d is determined based on lumasample values as follows:

dp0=abs(p _(2,0)−2*p _(1,0) +p _(0,0))

dp3=abs(p _(2,3)−2*p _(1,3) +p _(0,3))

dq0=abs(q _(2,0)−2*q _(1,0) +q _(0,0))

dq3=abs(q _(2,3)−2*q _(1,3) +q _(0,3))

dpq0=dp0+dq0

dpq3=dp3+dq3

dp=dp0+dp3

dq=dq0+dq3

d=dpq0+dpq3

Further, in ITU-T H.265 a variable dpq is set to a value based on thevalues of d and β. Finally, in ITU-T H.265, each of Bs, t_(C), β, and dare used to determine which filter type to apply (e.g., Strong Filter orWeak Filter). Further, in ITU-T H.265, for the chroma component, theNormal Filter is applied only when Bs equals 2. That is, in ITU-T H.265,deblocking only occurs for the chroma component if one the blocks P or Qis generated using an intra prediction mode.

It should be noted, that it may be useful to generally describe adeblocking filter according to a set of filter parameters. For example,for a set of sample values {a . . . b} included in a row or column, acorresponding deblocked sample value, y[n] may be specified based on thefollowing equation:

${y\lbrack n\rbrack} = {\sum\limits_{m = a}^{b}{{{coeff}\lbrack m\rbrack}{x\left\lbrack {n + m} \right\rbrack}}}$

-   -   Where,    -   A filter length is determined as abs(a−b+1);    -   coeff[m] provides a filter tap value (also referred to as a        filter coefficient). For example, for {a . . . b}={0 . . . 4}, a        set of tap values may be {1, 2, 3, 2, 1};    -   x[n+m] provides input sample values corresponding to support        samples, it should be noted that the support size may be greater        than or equal to the filter length.

Further, in ITU-T H.265, the deblocking filter may be applieddifferently to CTU boundaries that coincide with slice and tileboundaries compared with CTU boundaries that do not coincide with sliceand tile boundaries. Specifically, ITU-T H.265 specifies a flag,slice_loop_filter_across_slices_enabled_flag, present in a slice segmentheader that enables/disables the deblocking filter across CTU boundariesthat coincide with top and left slice boundaries. ITU-T H.265 providesthe following definition forslice_loop_filter_across_slices_enabled_flag:

slice_loop_filter_across_slices_enabled_flag equal to 1 specifies thatin-loop filtering operations may be performed across the left and upperboundaries of the current slice.slice_loop_filter_across_slices_enabled_flag equal to 0 specifies thatin-loop operations are not performed across left and upper boundaries ofthe current slice. The in-loop filtering operations include thedeblocking filter and sample adaptive offset filter. Whenslice_loop_filter_across_slices_enabled_flag is not present, it isinferred to be equal to pps_loop_filter_across_slices_enabled_flag.Where pps_loop_filter_across_slices_enabled_flag is present in a pictureparameter set (PPS) and ITU-T H.265 provides the following definitionfor pps_loop_filter_across_slices_enabled_flag:pps_loop_filter_across_slices_enabled_flag equal to 1 specifies thatin-loop filtering operations may be performed across left and upperboundaries of slices referring to the PPS.pps_loop_filter_across_slices_enabled_flag equal to 0 specifies thatin-loop filtering operations are not performed across left and upperboundaries of slices referring to the PPS. The in-loop filteringoperations include the deblocking filter and sample adaptive offsetfilter operations.NOTE—Loop filtering across slice boundaries can be enabled while loopfiltering across tile boundaries is disabled and vice versa.

Similarly, a flag, loop_filter_across_tiles_enabled_flag, present in aPPS enables/disables the deblocking filter across CTU boundaries thatcoincide with tile boundaries. ITU-T H.265 provides the followingdefinition for loop_filter_across_tiles_enabled_flag:

loop_filter_across_tiles_enabled_flag equal to 1 specifies that in-loopfiltering operations may be performed across tile boundaries in picturesreferring to the PPS. loop_filter_across_tiles_enabled_flag equal to 0specifies that in-loop filtering operations are not performed acrosstile boundaries in pictures referring to the PPS. The in-loop filteringoperations include the deblocking filter and sample adaptive offsetfilter operations. When not present, the value ofloop_filter_across_tiles_enabled_flag is inferred to be equal to 1.

As described above, for deblocking, the index Q is determined based onslice_beta_offset_div 2 and slice_tc_offset_div 2. In ITU-T H.265, thevalues of slice_beta_offset_div 2 and slice_tc_offset_div 2 may beincluded in a slice segment header and have the following definitions:

slice_beta_offset_div 2 and slice_tc_offset_div 2 specify the deblockingparameter offsets for β and t_(C) (divided by 2) for the current slice.The values of slice_beta_offset_div 2 and slice_tc_offset_div 2 shallboth be in the range of −6 to 6, inclusive. When not present, the valuesof slice_beta_offset_div 2 and slice_tc_offset_div 2 are inferred to beequal topps_beta_offset_div 2 and pps_tc_offset_div 2, respectively.Where pps_beta_offset_div 2 and pps_tc_offset_div 2 are present in a PPSand ITU-T H.265 provides the following definition forpps_beta_offset_div 2 and pps_tc_offset_div 2:pps_beta_offset_div 2 and pps_tc_offset_div 2 specify the defaultdeblocking parameter offsets for β and t_(C) (divided by 2) that areapplied for slices referring to the PPS, unless the default deblockingparameter offsets are overridden by the deblocking parameter offsetspresent in the slice headers of the slices referring to the PPS. Thevalues of pps_beta_offset_div 2 and pps_tc_offset_div 2 shall both be inthe range of −6 to 6, inclusive. When not present, the value ofpps_beta_offset_div 2 and pps_tc_offset_div 2 are inferred to be equalto 0.

As described above, ITU-T H.265 provides an 8×8 deblocking granularity.In JEM, deblocking is performed according to a grid specified by avariable minCUWidth for a horizontal boundary or a variable minCUHeightfor a vertical boundary, where the default values of minCUWidth andminCUHeight are 4. A value of d is also determined in JEM where thecalculation of d is same with that in ITU-T H.265. Based on the value ofd above, a determination is made whether to perform deblocking on theboundary. That is, if d<β, a deblocking filter is used for the currentboundary other, no deblocking is performed on the boundary. Further, inJEM a determination to use a strong or a weak filter is identical thatin ITU-T H.265. Finally, in the JEM reference software, the luma filtercoefficients for the strong deblocking filters is identical with thecoefficients used in ITU-T H.265. Deblocking as performed in ITU-T H.265and JEM may be less than ideal. In particular deblocking as perform inITU-T H.265 and JEM fail to consider various coding parameters andproperties of reconstructed video data when performing deblocking.

FIG. 7 is a block diagram illustrating an example of a system that maybe configured to code (i.e., encode and/or decode) video data accordingto one or more techniques of this disclosure. System 100 represents anexample of a system that may encapsulate video data according to one ormore techniques of this disclosure. As illustrated in FIG. 7, system 100includes source device 102, communications medium 110, and destinationdevice 120. In the example illustrated in FIG. 7, source device 102 mayinclude any device configured to encode video data and transmit encodedvideo data to communications medium 110. Destination device 120 mayinclude any device configured to receive encoded video data viacommunications medium 110 and to decode encoded video data. Sourcedevice 102 and/or destination device 120 may include computing devicesequipped for wired and/or wireless communications and may include, forexample, set top boxes, digital video recorders, televisions, desktop,laptop or tablet computers, gaming consoles, medical imagining devices,and mobile devices, including, for example, smartphones, cellulartelephones, personal gaming devices.

Communications medium 110 may include any combination of wireless andwired communication media, and/or storage devices. Communications medium110 may include coaxial cables, fiber optic cables, twisted pair cables,wireless transmitters and receivers, routers, switches, repeaters, basestations, or any other equipment that may be useful to facilitatecommunications between various devices and sites. Communications medium110 may include one or more networks. For example, communications medium110 may include a network configured to enable access to the World WideWeb, for example, the Internet. A network may operate according to acombination of one or more telecommunication protocols.Telecommunications protocols may include proprietary aspects and/or mayinclude standardized telecommunication protocols. Examples ofstandardized telecommunications protocols include Digital VideoBroadcasting (DVB) standards, Advanced Television Systems Committee(ATSC) standards, Integrated Services Digital Broadcasting (ISDB)standards, Data Over Cable Service Interface Specification (DOCSIS)standards, Global System Mobile Communications (GSM) standards, codedivision multiple access (CDMA) standards, 3rd Generation PartnershipProject (3GPP) standards, European Telecommunications StandardsInstitute (ETSI) standards, Internet Protocol (IP) standards, WirelessApplication Protocol (WAP) standards, and Institute of Electrical andElectronics Engineers (IEEE) standards.

Storage devices may include any type of device or storage medium capableof storing data. A storage medium may include a tangible ornon-transitory computer-readable media. A computer readable medium mayinclude optical discs, flash memory, magnetic memory, or any othersuitable digital storage media. In some examples, a memory device orportions thereof may be described as non-volatile memory and in otherexamples portions of memory devices may be described as volatile memory.Examples of volatile memories may include random access memories (RAM),dynamic random access memories (DRAM), and static random access memories(SRAM). Examples of non-volatile memories may include magnetic harddiscs, optical discs, floppy discs, flash memories, or forms ofelectrically programmable memories (EPROM) or electrically erasable andprogrammable (EEPROM) memories. Storage device(s) may include memorycards (e.g., a Secure Digital (SD) memory card), internal/external harddisk drives, and/or internal/external solid state drives. Data may bestored on a storage device according to a defined file format.

Referring again to FIG. 7, source device 102 includes video source 104,video encoder 106, data encapsulator 107, and interface 108. Videosource 104 may include any device configured to capture and/or storevideo data. For example, video source 104 may include a video camera anda storage device operably coupled thereto. Video encoder 106 may includeany device configured to receive video data and generate a compliantbitstream representing the video data. A compliant bitstream may referto a bitstream that a video decoder can receive and reproduce video datatherefrom. Aspects of a compliant bitstream may be defined according toa video coding standard. When generating a compliant bitstream videoencoder 106 may compress video data. Compression may be lossy(discernible or indiscernible to a viewer) or lossless.

FIG. 8 is a block diagram illustrating an example of video encoder 200that may implement the techniques for encoding video data describedherein. It should be noted that although example video encoder 200 isillustrated as having distinct functional blocks, such an illustrationis for descriptive purposes and does not limit video encoder 200 and/orsub-components thereof to a particular hardware or softwarearchitecture. Functions of video encoder 200 may be realized using anycombination of hardware, firmware, and/or software implementations. Inone example, video encoder 200 may be configured to encode video dataaccording to the techniques described herein. Video encoder 200 mayperform intra prediction coding and inter prediction coding of pictureareas, and, as such, may be referred to as a hybrid video encoder. Inthe example illustrated in FIG. 8, video encoder 200 receives sourcevideo blocks. In some examples, source video blocks may include areas ofpicture that has been divided according to a coding structure. Forexample, source video data may include macroblocks, CTUs, CBs,sub-divisions thereof, and/or another equivalent coding unit. In someexamples, video encoder may be configured to perform additionalsub-divisions of source video blocks. It should be noted that thetechniques described herein are generally applicable to video coding,regardless of how source video data is partitioned prior to and/orduring encoding. In the example illustrated in FIG. 9, video encoder 200includes summer 202, transform coefficient generator 204, coefficientquantization unit 206, inverse quantization/transform processing unit208, summer 210, intra prediction processing unit 212, inter predictionprocessing unit 214, filter unit 216, and entropy encoding unit 218. Asillustrated in FIG. 8, video encoder 200 receives source video blocksand outputs a bitstream.

In the example illustrated in FIG. 8, video encoder 200 may generateresidual data by subtracting a predictive video block from a sourcevideo block. Summer 202 represents a component configured to performthis subtraction operation. In one example, the subtraction of videoblocks occurs in the pixel domain. Transform coefficient generator 204applies a transform, such as a discrete cosine transform (DCT), adiscrete sine transform (DST), or a conceptually similar transform, tothe residual block or sub-divisions thereof (e.g., four 8×8 transformsmay be applied to a 16×16 array of residual values) to produce a set ofresidual transform coefficients. Transform coefficient generator 204 maybe configured to perform any and all combinations of the transformsincluded in the family of discrete trigonometric transforms. Transformcoefficient generator 204 may output transform coefficients tocoefficient quantization unit 206.

Coefficient quantization unit 206 may be configured to performquantization of the transform coefficients. As described above, thedegree of quantization may be modified by adjusting a quantizationscaling factor which may be determined by quantization parameters.Coefficient quantization unit 206 may be further configured to determinequantization values and output QP data that may be used by a videodecoder to reconstruct a quantization parameter to perform inversequantization during video decoding. For example, signaled QP data mayinclude QP delta values. In ITU-T H.265, the degree of quantizationapplied to a set of transform coefficients may depend on slice levelparameters, parameters inherited from a previous coding unit, and/oroptionally signaled CU level delta values.

As illustrated in FIG. 8, quantized transform coefficients are output toinverse quantization/transform processing unit 208. Inversequantization/transform processing unit 208 may be configured to apply aninverse quantization and/or an inverse transformation to generatereconstructed residual data. As illustrated in FIG. 8, at summer 210,reconstructed residual data may be added to a predictive video block. Inthis manner, an encoded video block may be reconstructed and theresulting reconstructed video block may be used to evaluate the encodingquality for a given quality for a given prediction, transformation type,and/or level of quantization. Video encoder 200 may be configured toperform multiple coding passes (e.g., perform encoding while varying oneor more coding parameters). The rate-distortion of a bitstream or othersystem parameters may be optimized based on evaluation of reconstructedvideo blocks. Further, reconstructed video blocks may be stored and usedas reference for predicting subsequent blocks.

As described above, a video block may be coded using an intraprediction. Intra prediction processing unit 212 may be configured toselect an intra prediction mode for a video block to be coded. Intraprediction processing unit 212 may be configured to evaluate a frameand/or an area thereof and determine an intra prediction mode to use toencode a current block. As illustrated in FIG. 8, intra predictionprocessing unit 212 outputs intra prediction data (e.g., syntaxelements) to filter unit 216 and entropy encoding unit 218.

Inter prediction processing unit 214 may be configured to perform interprediction coding for a current video block. Inter prediction processingunit 214 may be configured to receive source video blocks and calculatea motion vector for PUs, or the like, of a video block. A motion vectormay indicate the displacement of a PU, or the like, of a video blockwithin a current video frame relative to a predictive block within areference frame. Inter prediction coding may use one or more referencepictures. Further, motion prediction may be uni-predictive (use onemotion vector) or bi-predictive (use two motion vectors). Interprediction processing unit 214 may be configured to select a predictiveblock by calculating a pixel difference determined by, for example, sumof absolute difference (SAD), sum of square difference (SSD), or otherdifference metrics. A motion vector and associated data may describe,for example, a horizontal component of the motion vector, a verticalcomponent of the motion vector, a resolution for the motion vector(e.g., one-quarter pixel precision), a prediction direction and/or areference picture index value. Further, a coding standard, such as, forexample ITU-T H.265, may support motion vector prediction. Motion vectorprediction enables a motion vector to be specified using motion vectorsof neighboring blocks. Examples of motion vector prediction includeadvanced motion vector prediction (AMVP), temporal motion vectorprediction (TMVP), so-called “merge” mode, and “skip” and “direct”motion inference. Inter prediction processing unit 214 may be configuredto perform motion vector prediction according to one or more of thetechniques described above. Inter prediction processing unit 214 may beconfigured to generate a predictive block using the motion predictiondata. For example, inter prediction processing unit 214 may locate apredictive video block within a frame buffer (not shown in FIG. 8). Itshould be noted that inter prediction processing unit 214 may further beconfigured to apply one or more interpolation filters to a reconstructedresidual block to calculate sub-integer pixel values for use in motionestimation. Inter prediction processing unit 214 may output motionprediction data for a calculated motion vector to filter unit 216 andentropy encoding unit 218.

As described above, deblocking refers to the process of smoothing theboundaries of reconstructed video blocks. As illustrated in FIG. 8,filter unit 216 receives reconstructed video blocks and codingparameters (e.g., intra prediction data, inter prediction data, and QPdata) and outputs modified reconstructed video data. Filter unit 216 maybe configured to perform deblocking and/or Sample Adaptive Offset (SAO)filtering. SAO filtering is a non-linear amplitude mapping that may beused to improve reconstruction by adding an offset to reconstructedvideo data. It should be noted that as illustrated in FIG. 8, intraprediction processing unit 212 and inter prediction processing unit 214may receive modified reconstructed video block via filter unit 216. Thatis, in some cases, deblocking may occur in-loop, i.e., predictive videoblocks stored in a reference buffer may be filtered. In some cases,deblocking may occur post-loop, i.e., after video data has beenreconstructed and prior to being output to a display, for example. Thetechniques described herein may be applicable in-loop deblocking,post-loop deblocking, and/or combinations thereof.

As described above, deblocking as performed in ITU-T H.265 and JEM maybe less than ideal. In one example, according to the techniques herein,filter unit 216 may be configured to select different filtering lines(in some cases, the number of samples deblocked on each side of boundarymay be different) based on one or more of: block size on each side ofboundary (one or both), boundary strength, prediction mode used byblocks on each side of boundary, prediction mode (e.g. intra, inter,skip) of sample being deblocked (e.g., use weaker filter for boundaryclose to reference samples), QP value of sample being deblocked, blocksize corresponding to the sample being deblocked, block sizecorresponding to the samples being used for deblocking, motion vectorsfor blocks on each side of boundary being deblocked, motion vectors forsample being deblocked, and/or motion vectors for sample being used fordeblocking.

Samples on each side of a block boundary (perpendicular to the boundaryedge) may be represented as:

. . . p ₈ p ₇ p ₆ p ₅ p ₄ p ₃ p ₂ p ₁ p ₀ |q ₀ q ₁ q ₂ q ₃ q ₄ q ₅ q ₆ q₇ q ₈ . . .

-   -   Where,    -   | represents the block boundary edge.    -   The samples p_(x), where x is a positive integer starting at 0,        represents the P-side of the boundary.    -   The samples q_(y) where y is a positive integer starting at 0,        represents the Q-side of the boundary.

In an example, P-side represents samples outside the current CU, Q-siderepresents samples inside the current CU.

In an example, P-side represents samples inside the current CU, Q-siderepresents samples outside the current CU.

In an example, P-side represents samples outside the current block,Q-side represents samples inside the current block.

In an example, P-side represents samples inside the current block,Q-side represents samples outside the current block.

Referring FIG. 5A, samples p_(y,x) and q_(y,x) correspond to line R[x]when deblocking vertical edge.

Referring FIG. 5B, samples p_(y,x) and q_(y,x) correspond to line R[y]when deblocking horizontal edge.

One example of a wider (i.e. larger number of samples deblocked),stronger filter for P-side of the boundary, referred to as WS00P P-sidefilter, is:

p ₆′=(7*p ₇+2*p ₆ +p ₅ +p ₄ +p ₃ +p ₂ +p ₁ +p ₀ +q ₀+8)>>4

p ₅′=(6*p ₇ +p ₆+2*p ₅ +p ₄ +p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁+8)>>4

p ₄′=(5*p ₇ +p ₆ +p ₅+2*p ₄ +p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂+8)>>4

p ₃′=(4*p ₇ +p ₆ +p ₅ +p ₄+2*p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q₃++8)>>4

p ₂′=(3*p ₇ +p ₆ +p ₅ +p ₄ +p ₃+2*p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q₄+8)>>4

p ₁′=(2*p ₇ +p ₆ +p ₅ +p ₄ +p ₃ +p ₂+2*p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q ₄+q ₅+8)>>4

p ₀′=(p ₇ +p ₆ +p ₅ +p ₄ +p ₃ +p ₂ +p ₁+2*p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q ₄+q ₅ +q ₆+8)>>4

-   -   where, p_(x)′ represents the sample value after deblocking at        position corresponding to p_(x)

One example of a wider (i.e. larger number of samples deblocked),stronger filter for Q-side of the boundary, referred to as WS00Q Q-sidefilter, is:

q ₆′=(7*q ₇+2*q ₆ +q ₅ +q ₄ +q ₃ +q ₂ +q ₁ +q ₀ +p ₀+8)>>4

q ₅′=(6*q ₇ +q ₆+2*q ₅ +q ₄ +q ₃ +q ₂ +q ₁ +q ₀ +p ₀ +p ₁+8)>>4

q ₄′=(5*q ₇ +q ₆ +q ₅+2*q ₄ +q ₃ +q ₂ +q ₁ +q ₀ +p ₀ +p ₁ +p ₂+8)>>4

q ₃′=(4*q ₇ +q ₆ +q ₅ +q ₄+2*q ₃ +q ₂ +q ₁ +q ₀ +p ₀ +p ₁ +p ₂ +p₃+8)>>4

q ₂′=(3*q ₇ +q ₆ +q ₅ +q ₄ +q ₃+2*q ₂ +q ₁ +q ₀ +p ₀ +p ₁ +p ₂ +p ₃ +p₄+8)>>4

q ₁′=(2*q ₇ +q ₆ +q ₅ +q ₄ +q ₃ +q ₂+2*q ₁ +q ₀ +p ₀ +p ₁ +p ₂ +p ₃ +p ₄+p ₅+8)>>4

q ₀′=(q ₇ +q ₆ +q ₅ +q ₄ +q ₃ +q ₂ +q ₁+2*q ₀ +p ₀ +p ₁ +p ₂ +p ₃ +p ₄+p ₅ +p ₆+8)>>4

-   -   where, q_(x)′ represents the sample value after deblocking at        position corresponding to q_(x)

One example of a narrow (i.e. smaller number of samples deblocked),strong filter for P-side of the boundary, referred to as HEVC P P-sidefilter, is:

p ₀′=(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)>>3

p ₁′=(p ₂ +p ₁ +p ₀ +q ₀+2)>>2

p ₂′=(2*p ₃+3*p ₂ +p ₁ +p ₀ +q ₀+4)>>3

-   -   where, p_(x)′ represents the sample value after deblocking at        position corresponding to p_(x)

One example of a narrow (i.e. smaller number of samples deblocked),strong filter for Q-side of the boundary, referred to as HEVC_Q Q-sidefilter, is:

q ₀′=(p ₁+2*p ₀+2*q ₀+2*q ₁ +q ₂+4)>>3

q ₁′=(p ₀ +q ₀ +q ₁ +q ₂+2)>>2

q ₂′=(p ₀ +q ₀ +q ₁+3*q ₂+2*q ₃+4)>>3

-   -   where, q_(x)′ represents the sample value after deblocking at        position corresponding to q_(x)

One example of a narrow (smaller number of samples deblocked), strongfilter for P-side of the boundary, referred to as NS00P P-side filter,is:

p ₀′=(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)>>3

p ₁′=(p ₂ +p ₁ +p ₀ +q ₀+4)>>3

p ₂′=(p ₄+2*p ₃+3*p ₂ +p ₁ +p ₀+4)>>3

-   -   where, p_(x)′ represents the sample value after deblocking at        position corresponding to p_(x)

One example of a narrow (smaller number of samples deblocked), strongfilter for Q-side of the boundary, referred to as NS00Q Q-side filter,is:

q ₀′=(q ₂+2*q ₁+2*q ₀+2*p ₀ +p ₁+4)>>3

q ₁′=(q ₂ +q ₁ +q ₀ +p ₀+4)>>3

q ₂′=(q ₄+2*q ₃+3*q ₂ +q ₁ +q ₀+4)>>3

-   -   where, q_(x)′ represents the sample value after deblocking at        position corresponding to q_(x)

One example of a narrow (smaller number of samples deblocked), strongfilter for P-side of the boundary, referred to as NS00P P-side filter,is:

p ₀′=(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)>>3

p ₁′=(p ₂ +p ₁ +p ₀ +q ₀+2)>>2

p ₂′=(p ₄+2*p ₃+3*p ₂ +p ₁ +p ₀+4)>>3

One example of a narrow (smaller number of samples deblocked), strongfilter for Q-side of the boundary, referred to as NS00Q Q-side filter,is:

q ₀′=(q ₂+2*q ₁+2*q ₀+2*p ₀ +p ₁+4)>>3

q ₁′=(q ₂ +q ₁ +q ₀ +p ₀+2)>>2

q ₂′=(q ₄+2*q ₃+3*q ₂ +q ₁ +q ₀+4)>>3

One example of a narrow (smaller number of samples deblocked), strongfilter for P-side of the boundary, referred to as NS00P P-side filter,is:

p ₀′=(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)>>3

p ₁′=(p ₂ +p ₁ +p ₀ +q ₀+2)>>2

p ₂′=(2*p ₃+3*p ₂ +p ₁ +p ₀ +q ₀+4)>>3

One example of a narrow (smaller number of samples deblocked), strongfilter for Q-side of the boundary, referred to as NS00Q Q-side filter,is:

q ₀′=(q ₂+2*q ₁+2*q ₀+2*p ₀ +p ₁+4)>>3

q ₁′=(q ₂ +q ₁ +q ₀ +p ₀+2)>>2

q ₂′=(2*q ₃+3*q ₂ +q ₁ +q ₀ +p ₀+4)>>3

One example of a narrow (smaller number of samples deblocked), weakfilter for P-side of the boundary, referred to as NW00P P-side filter,is:

Δ=Clip3(−t _(C) ,t _(C),((((q ₀ −p ₀)<<2)+p ₁ −q ₁+4)>>3))

p ₀′=Clip1_(C)(p ₀+Δ)

-   -   where, p_(x)′ represents the sample value after deblocking at        position corresponding to p_(x)

One example of a narrow (smaller number of samples deblocked), weakfilter for Q-side of the boundary, referred to as NW00Q Q-side filter,is:

Δ=Clip3(−t _(C) ,t _(C),((((q ₀ −p ₀)<<2)+p ₁ −q ₁+4)>>3))

q ₀′=Clip1_(C)(q ₀−Δ)

-   -   where, q_(x)′ represents the sample value after deblocking at        position corresponding to q_(x)

One example of a filter for P-side of the boundary, referred to as FOPP-side filter, is:

p ₀′=(136*p ₈+120*q ₈+128)>>8

p ₁′=(151*p ₇+105*q ₉+128)>>8

p ₂′=(166*p ₆+90*q ₁₀+128)>>8

p ₃′=(181*p ₅+75*q ₁₁+128)>>8

p ₄′=(196*p ₄+60*q ₁₂+128)>>8

p ₅′=(211*p ₃+45*q ₁₃+128)>>8

p ₆′=(226*p ₂+30*q ₁₄+128)>>8

p ₇′=(241*p ₁+15*q ₁₅+128)>>8

One example of a filter for Q-side of the boundary, referred to as F0QQ-side filter, is:

q ₀′=(120*p ₀+136*q ₇+128)>>8

q ₁′=(105*p ₁₀+151*q ₆+128)>>8

q ₂′=(90*p ₁₁+166*q ₅+128)>>8

q ₃′=(75*p ₁₂+181*q ₄+128)>>8

q ₄′=(60*p ₁₃+196*q ₃+128)>>8

q ₅′=(45*p ₁₄+211*q ₂+128)>>8

q ₆′=(30*p ₁₅+226*q ₁+128)>>8

q ₇′=(15*p ₁₆+241*q ₀+128)>>8

One example of a filter for P-side of the boundary, referred to as F1PP-side filter, is:

p ₀′=(2*p ₁+4*p ₀ +q ₀ +q ₁+4)>>3

p ₁′=(2*p ₂+4*p ₁ +p ₀ +q ₀+4)>>3

p ₂′=(p ₃ +p ₂ +p ₁ +p ₀+²)>>2

p ₃′=(p ₄ +p ₃ +p ₂ +p ₁+2)>>2

One example of a filter for Q-side of the boundary, referred to as F1QQ-side filter, is:

q ₀′=(2*q ₁+4*q ₀ +p ₀ +p ₁+4)>>3

q ₁′=(2*q ₂+4*q ₁ +q ₀ +p ₀+4)>>3

q ₂′=(q ₃ +q ₂ +q ₁ +q ₀+2)>>2

q ₃′=(q ₄ +q ₃ +q ₂ +q ₁+2)>>2

In one example, the distance of a sample being deblocked from theboundary may be inversely proportional to the distance between thesupport sample assigned the largest tap value and the sample beingdeblocked. Further, the distance of a second largest tap value from asample being deblocked may be proportional to the distance of the samplefrom the boundary. Filters F2P and F2Q described below provide exampleimplementations of such a filtering. One example of a filter for P-sideof the boundary, referred to as F2P P-side filter, is:

p ₀′=(136*p ₈+2*p ₀+120*q ₈+256)>>9

p ₁′=(151*p ₇+4*p ₁+105*q ₉+256)>>9

p ₂′=(166*p ₆+8*p ₂+90′*q ₁₀+256)>>9

p ₃′=(181*p ₅+16*p ₃+75*q ₁₁+256)>>9

p ₄′=(196*p ₄+32*p ₄+60*q ₁₂+256)>>9

p ₅′=(211*p ₃+64*p ₅+45*q ₁₃+256)>>9

p ₆′=(226*p ₂+128*p ₆+30*q ₁₄+256)>>9

p ₇′=(241*p ₁+256*p ₇+15*q ₁₅+256)>>9

One example of a filter for Q-side of the boundary, referred to as F2QQ-side filter, is:

q ₀′=(120*p ₉+2*q ₀+136*q ₇+256)>>9

q ₁′=(105*p ₁₀+4*q ₁+151*q ₆+256)>>9

q ₂′=(90*p ₁₁+8*q ₂+166*q ₅+256)>>9

q ₃′=(75*p ₁₂+16*q ₃+181*q ₄+256)>>9

q ₄′=(60*p ₁₃+32*q ₄+196*q ₃+256)>>9

q ₅′=(45*p ₁₄+64*q ₅+211*q ₂+256)>>9

q ₆′=(30*p ₁₅+128*q ₆+226*q ₁+256)>>9

q ₇′=(15*p ₁₆+256*q ₇+241*q ₀+256)>>9

One example of a filter for P-side of the boundary, referred to as F4PP-side filter, is:

p ₆′=(7*p ₇+2*p ₆ +p ₅ +p ₄ +p ₃ +p ₂ +p ₁ +p ₀ +q ₀+8)>>4

p ₅′=(6*p ₇ +p ₆+2*p ₅ +p ₄ +p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁+8)>>4

p ₄′=(5*p ₇ +p ₆ +p ₅+2*p ₄ +p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂+8)>>4

p ₃′=(4*p ₇ +p ₆ +p ₅ +p ₄+2*p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q₃+8)>>4

p ₂′=(3*p ₇ +p ₆ +p ₅ +p ₄ +p ₃+2*p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q₄+8)>>4

p ₁′=(2*p ₇ +p ₆ +p ₅ +p ₄ +p ₃ +p ₂+2*p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q ₄+q ₅+8)>>4

p ₀′=(p ₇ +p ₆ +p ₅ +p ₄ +p ₃ +p ₂ +p ₁+2*p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q ₄+q ₅ +q ₆+8)>>4

One example of a filter for Q-side of the boundary, referred to as F4QQ-side filter, is:

q ₆′=(7*q ₇+2*q ₆ +q ₅ +q ₄ +q ₃ +q ₂ +q ₁ +q ₀ +p ₀+8)>>4

q ₅′=(6*q ₇ +q ₆+2*q ₅ +q ₄ +q ₃ +q ₂ +q ₁ +q ₀ +p ₀ +p ₁+8)>>4

q ₄′=(5*q ₇ +q ₆ +q ₅+2*q ₄ +q ₃ +q ₂ +q ₁ +q ₀ +p ₀ +p ₁ +p ₂+8)>>4

q ₃′=(4*q ₇ +q ₆ +q ₅ +q ₄+2*q ₃ +q ₂ +q ₁ +q ₀ +p ₀ +p ₁ +p ₂ +p₃+8)>>4

q ₂′=(3*q ₇ +q ₆ +q ₅ +q ₄ +q ₃+2*q ₂ +q ₁ +q ₀ +p ₀ +p ₁ +p ₂ +p ₃ +p₄+8)>>4

q ₁′=(2*q ₇ +q ₆ +q ₅ +q ₄ +q ₃ +q ₂+2*q ₁ +q ₀ +p ₀ +p ₁ +p ₂ +p ₃ +p ₄+p ₅+8)>>4

q ₀′=(q ₇ +q ₆ +q ₅ +q ₄ +q ₃ +q ₂ +q ₁+2*q ₀ +p ₀ +p ₁ +p ₂ +p ₃ +p ₄+p ₅ +p ₆+8)>>4

One example of a filter for P-side of the boundary, referred to asCL_P-side filter, is:

p ₂′=(3*p ₃+2*p ₂ +p ₁ +p ₀ +q ₀+4)>>3

p ₁′=(2*p ₃ +p ₂+2*p ₁ +p ₀ +q ₀ +q ₁+4)>>3

p ₀=(p ₃ +p ₂ +p ₁+2*p ₀ +q ₀ +q ₁ +q ₂+4)>>3

One example of a filter for Q-side of the boundary, referred to as CL_qQ-side filter, is:

q ₂′=(3*q ₃+2*q ₂ +q ₁ +q ₀ +p ₀+4)>>3

q ₁′=(2*q ₃ +q ₂+2*q ₁ +q ₀ +p ₀ +p ₁+4)>>3

q ₀′=(q ₃ +q ₂ +q ₁+2*q ₀ +p ₀ +p ₁ +p ₂+4)>>3

In one example, according to the techniques herein, gradient computationmay be used in selection of filter parameters, number of samples to bedeblocked on one (or both) side of block boundary. Gradient may becomputed using samples in line R[x].

In an example multiple gradients may be computed using samples in lineR[x] and used in selection of filter parameters, number of samples to bedeblocked on one (or both) side of block boundary. In another example,multiple gradients may be computed using samples in line R[x] andoperations such as averaging of gradients, maximum gradient, minimumgradient, may be used in selection of filter parameters, number ofsamples to be deblocked on one (or both) side of block boundary.

In one example, function invocation xCalDQp(R[x]) computes gradient, asfollows:

abs(p ₂−2*p ₁ +p ₀)

In one example, function invocation xCalDQq(R[x]) computes gradient, asfollows:

abs(q ₂−2*q ₁ +q ₀)

In one example, function invocation xCalDQpLargeBlock(R[x]) computesgradient, as follows:

Max(Max(Max(Max(Max(abs(p ₂−2*p ₁ +p ₀),abs(p ₃−2*p ₂ +p ₁)),abs(p ₄−2*p₃ +p ₂)),abs(p ₅−2*p ₄ +p ₃)),abs(p ₆−2*p ₅ +p ₄)),abs(p ₇−2*p ₆ +p ₅))

In one example, function invocation xCalDQqLargeBlock(R[x]) computesgradient, as follows:

Max(Max(Max(Max(Max(abs(q ₂−2*q ₁ +q ₀),abs(q ₃2*q ₂ +q ₁)),abs(q ₄−2*q₃ +q ₂)),abs(q ₅−2*q ₄ +q ₃)),abs(q ₆−2*q ₅ +q ₄)),abs(q ₇−2*q ₆ +q ₅))

In one example, function invocation xCalDQpLargeBlock(R[x]) computesgradient, as follows:

(abs(p ₂−2*p ₁ +p ₀)+abs(p ₃−2*p ₂ +p ₁)+abs(p ₅−2*p ₄ +p ₃)+abs(p ₇−2*p₆ +p ₅)+4)>>2

In one example, function invocation xCalDQqLargeBlock(R[x]) computesgradient, as follows:

(abs(q ₂−2*q ₁ +q ₀)+abs(q ₃−2*q ₂ +q ₁)+abs(q ₅−2*q ₄ +q ₅)+abs(q ₇−2*q₆ +q ₅)+4)>>2

In one example, function invocation xCalDQpLargeBlock(R[x]) computesgradient, as follows:

(abs(p ₂−2*p ₁ +p ₀)+abs(p ₃−2*p ₂ +p ₁)+abs(p ₅−2*p ₄ +p ₃)+abs(p ₇−2*p₆ +p ₅)+2)>>2

In one example, function invocation xCalDQqLargeBlock(R[x]) computesgradient, as follows:

(abs(q ₂−2*q ₁ +q ₀)+abs(q ₃−2*q ₂ +q ₁)+abs(q ₅−2*q ₄ +q ₃)+abs(q ₇−2*q₄ +q ₅)+2)>>2

In one example, function invocation xCalDQpLargeBlock(R[x]) computesgradient, as follows:

(abs(p ₂−2*p ₁ +p ₀)+abs(p ₃−2*p ₂ +p ₁)+abs(p ₄−2*p ₃ +p ₂)+abs(p ₅−2*p₄ +p ₃)+4)>>2

In one example, function invocation xCalDQqLargeBlock(R[x]) computesgradient, as follows:

(abs(q ₂−2*q ₁ +q ₀)+abs(q ₃−2*q ₂ +q ₁)+abs(q ₄−2*q ₃ +q ₂)+abs(q ₅−2*q₄ +q ₃)+4)>>2

In one example, function invocation xCalDQpLargeBlock(R[x]) computesgradient, as follows:

(abs(p ₂−2*p ₁ +p ₀)+abs(p ₃−2*p ₂ +m)+abs(p ₄−2*p ₃ +p ₂)+abs(p ₅−2*p ₄+p ₃)+2)>>2

In one example, function invocation xCalDQqLargeBlock(R[x]) computesgradient, as follows:

(abs(q ₂−2*q ₁ +q ₀)+abs(q ₃−2*q ₂ +q ₁)+abs(q ₄−2*q ₃ +q ₂)+abs(q ₅−2*q₄ +q ₃)+2)>>2

In one example, function invocation xCalDQpLargeBlock(R[x]) computesgradient, as follows:

(abs(p ₂−2*p ₁ +p ₀)+abs(p ₅−2*p ₄ +p ₃)+1)>>1

In one example, function invocation xCalDQqLargeBlock(R[x]) computesgradient, as follows:

(abs(q ₂−2*q ₁ +q ₀)+abs(q ₅−2*q ₄ +q ₃)+1)>>1

In one example, a subset of second-order differences computed at p₁, p₂,. . . , p₆ may be used to compute xCalDQpLargeBlock(R[x]) where secondorder difference at p_(n) is abs(p_(n−1)−2*p_(n)+p_(n+1)). Similarly, asubset of second-order differences computed at q₁, q₂, . . . , q₆ may beused to compute xCalDQqLargeBlock(R[x]) In one example, the roundingoffset in the function invocation xCalDQpLargeBlock(R[x]) andxCalDQqLargeBlock(R[x]) can be dropped.

In one example, function invocation xUseStrongFilteringLargeBlock (R[x],d, bSidePisLargeBlk, bSideQisLargeBlk) computes a Boolean variable, asfollows, where examples for determined bSidePisLargeBlk,bSideQisLargeBlk are provided below:

((abs((bSidePisLargeBlk?p ₇ :p ₄)−p ₀)+abs((bSideQisLargeBlk?q ₇ :q ₄)−q₀)<(β>>3))&&(d<(β>>2))&&(abs(q ₀ −p ₀)<((t _(C)*5+1)>>1)))?TRUE:FALSE,where β and t _(C) are thresholds.

In one example, function invocation xUseStrongFilteringLargeBlock (R[x],d, bSidePisLargeBlk, bSideQisLargeBlk) computes a Boolean variable, asfollows:

sp₃ = Abs( p₃ − p₀ ) if (bSidePisLargeblk) { sp3 = max( sp3, max(Abs( p₇− p₃ ), Abs( p₇ − p₀ )) } sq₃ = Abs( q₀ − q₃ ) if (bSideQisLargeblk) {sq₃ = max( sq₃, max(Abs( q₇ − q₃ ), Abs( q₇ − q₀ ))) }xUseStrongFilteringLargeBlock: sp₃ + sq₃ < (β>> 3) && (d < (β >> 2)) &&(abs(q₀− p₀) < ((t_(C) * 5 + 1) >> 1)))? TRUE:FALSE.

In one example, function invocation xUseStrongFilteringLargeBlock (R[x],d, bSidePisLargeBlk, bSideQisLargeBlk) computes a Boolean variable, asfollows:

sp₃ = Abs( p₃ − p₀ ) if (bSidePisLargeblk) { sp₃ = (sp₃ + Abs( p₇ − p₃) + 1)>>1 } sq₃ = Abs( q₀ − q₃ ) if (bSideQisLargeblk) { sq₃ = (sq₃ +Abs( q₇ − q₃ ) ) + 1)>>1 } xUseStrongFilteringLargeBlock: sp₃ + sq₃ <(β>> 3) && (d < (β >> 2)) && (abs(q₀− p₀) < ((t_(C) * 5 + 1) >> 1)))?TRUE:FALSE

In one example, function invocation xUseStrongFilteringLargeBlock (R[x],d, bSidePisLargeBlk, bSideQisLargeBlk) computes a Boolean variable, asfollows:

sp₃ = Abs( p₃ − p₀ ) if (bSidePisLargeblk) { sp₃ = (sp₃ + Abs( p₇ − p₀ )) + 1)>>1 } sq₃ = Abs( q₀ − q₃ ) if (bSideQisLargeblk) { sq₃ = (sq₃ +Abs( q₇ − q₀ ) + 1)>>1 } xUseStrongFilteringLargeBlock: sp₃ + sq₃ < (β>>3) && (d < (β >> 2)) && (abs(q₀− p₀) < ((t_(C) * 5 + 1) >> 1)))?TRUE:FALSE

In one example, the rounding offset in the function invocationxUseStrongFilteringLargeBlock can be dropped.

In one example, the condition used in selecting number of samples to bedeblocked on one (or both) side of a boundary corresponds to thedimension (of current and/or neighboring block), perpendicular to blockboundary, exceeding a threshold. In some cases, when a subset oftransform coefficients is set to zero for a block, based on block size,then the threshold used in the comparison may be based on the propertiesof the subset of zero coefficients. For example, when transformcoefficients is set to zero for coefficients in column position greaterthan or equal to 32 and row position greater than or equal to 32 (withrow, column indexing starting at 0). then the dimension perpendicular toblock boundary is compared to threshold value of 32.

In an example a signal may be received in the bitstream indicatingwhether all transform coefficients are zero for a block of samples. Sucha signal may be received for e.g. for each color component, for a groupof color components, for some spatial partitioning of samples, for somespatio-temporal partitioning of samples. In HEVC, for each colorcomponent a coded block flag (CBF) was signaled (either explicitly orimplicitly by use of an inference rule in case of absence of explicitsignal)—cbf_luma, cbf_cb, cbf_cr; moreover a flag was also signaled(explicitly and implicitly) indicating if any of the color components inthe transform tree contained non-zero transform coefficients and wasreferred to as residual quad tree root CBF—rqt_root_cbf.

In one example the number of samples to be deblocked on one (or both)side of a boundary may be based on the type of edge being deblocked(e.g. vertical block edge, horizontal block edge). channel type (e.g.luma, chroma), whether all transform coefficients are zero for block ofsamples on one (or both) side of a boundary, whether block of samples onone (or both) side of boundary make use of coding modes such as LocalIllumination Compensation (LIC) which may be based on a linear model forillumination changes, whether block of samples on one (or both) side ofboundary make use of cross component prediction (which may be based onlinear model), whether block of samples on one (or both) side ofboundary make use prediction that is determined for blocks smaller thanthe transform, whether block of samples on one (or both) side ofboundary make use techniques wherein large block (e.g. CU) ispartitioned into sub-blocks (e.g. sub-CUs) and motion information isderived for these sub-blocks.

In one example, according to the techniques herein, a larger number ofsamples is (e.g. 7) is deblocked on each side of the block boundary whendimension of the current block, perpendicular to the block boundary, isgreater than or equal to a threshold (e.g. 32) and a smaller number ofsamples (e.g. 3) is deblocked on each side of the block boundary whendimension of the current block, perpendicular to the block boundary, issmaller than a threshold (e.g. 32). For example, if ((width of currentblock>=32 and edge type is vertical) or (height of current block>=32 andedge type is horizontal)) deblock larger number of samples on each sideof the block boundary.

In one example, according to the techniques herein, a larger number ofsamples is (e.g. 7) is deblocked on the side of the block boundary wheredimension of the block, perpendicular to the block boundary, is greaterthan or equal to a threshold (e.g. 32) and a smaller number of samples(e.g. 3) is deblocked on side of the block boundary where dimension ofthe block, perpendicular to the block boundary, is smaller than athreshold (e.g. 32). For example: if ((width of one block>=32 and edgetype is vertical) or (height of one block>=32 and edge type ishorizontal)) deblock larger number of samples for that block at theblock boundary. Here if the left-side of a vertical boundary edge has ablock size 4 (rows)×64 (columns) and the right-side has a block size 4(rows)×16 (columns) then larger number of samples may be deblocked onleft-side versus the right side.

In one example, according to the techniques herein, filter unit 216 maybe configured to select filter parameters (including, e.g., a number ofcoefficients) used for deblocking based on one or more of: distance ofsample being deblocked (in number of samples) from boundary, blocksize(s) on each side of boundary, boundary strength, prediction modeused by blocks on each side of boundary, prediction mode of sample beingdeblocked (e.g., use weaker filter for boundary close to referencesamples), QP of sample being deblocked (e.g., use stronger filters forlarger QP), block size corresponding to the sample being deblocked(e.g., use stronger filters for larger block size), block sizecorresponding to the samples being used for deblocking, motion vectorsfor blocks on each side of boundary being deblocked (e.g., if the MVdifference is larger than a threshold then do not perform any deblockingsince samples on different side of the boundary may belong to differentobjects), and/or motion vectors for sample being deblocked; motionvectors for sample being used for deblocking. It should be noted that,block size corresponding to a sample may include the block size of CUthe sample belongs to, block size of TU the sample belongs, to or theblock size of PU the sample belongs to.

In one example, according to the techniques herein, filter unit 216 maybe configured to select filter parameters (including, e.g., a number ofcoefficients) used for deblocking based on the type of edge beingdeblocked (e.g. vertical block edge, horizontal block edge), channeltype (e.g. luma, chroma), whether all transform coefficients are zerofor block of samples on one (or both) side of a boundary, whether blockof samples on one (or both) side of boundary make use of coding modessuch as Local Illumination Compensation (LIC) which may be based on alinear model for illumination changes, whether block of samples on one(or both) side of boundary make use of cross component prediction (whichmay be based on linear model), whether block of samples on one (or both)side of boundary make use prediction that is determined for blockssmaller than the transform, whether block of samples on one (or both)side of boundary make use techniques wherein large block (e.g. CU) ispartitioned into sub-blocks (e.g. sub-CUs) and motion information isderived for these sub-blocks.

In one example, according to the techniques herein, filter unit 216 maybe configured to select filter parameters (including, e.g., a number ofcoefficients) used for deblocking based on the type of edge beingdeblocked (e.g. vertical block edge, horizontal block edge), channeltype (e.g. luma, chroma), whether all transform coefficients are zerofor block of samples on one (or both) side of a boundary, whether blockof samples on one (or both) side of boundary make use of coding modessuch as Local Illumination Compensation (LIC) which may be based on alinear model for illumination changes, whether block of samples on one(or both) side of boundary make use of cross component prediction (whichmay be based on linear model), whether block of samples on one (or both)side of boundary make use prediction that is determined for blockssmaller than the transform, whether block of samples on one (or both)side of boundary make use techniques wherein large block (e.g. CU) ispartitioned into sub-blocks (e.g. sub-CUs) and motion information isderived for these sub-blocks.

In one example selecting filter parameters may include selecting widerstronger filtering.

In one example, according to the techniques herein, filter unit 216 maybe configured to select a set of deblocking filter parameters (e.g.wider stronger filtering) for both sides when dimension of the currentblock, perpendicular to the block boundary, is greater than or equal toa threshold (e.g. 32). For example, if ((width of current block>=32 andedge type is vertical) or (height of current block>=32 and edge type ishorizontal)) then wider stronger filtering is selected for each side ofthe block boundary.

In one example, according to the techniques herein, filter unit 216 maybe configured to select filter parameters for each side of blockboundary independently based on dimension of the block, perpendicular tothe block boundary, for the corresponding side. For example, whendimension of the block perpendicular to the block boundary on one sideis greater than or equal to a threshold (e.g. 32) then a set ofdeblocking filter parameters (e.g. wider stronger filtering) may beselected for that side. For example: if ((width of one block>=32 andedge type is vertical) or (height of one block>=32 and edge type ishorizontal)) wider stronger filtering is selected for the side of theblock boundary corresponding to the block.

In one example, according to the techniques herein, sub-CU boundary maybe deblocked based on whether all transform coefficients are zero forblocks (e.g. CU) on one (or both) side of a boundary. For example,deblock sub-CU boundary when all the transform coefficients for the CUis zero.

In one example, according to the techniques herein, sub-block boundarymay be deblocked based on whether all transform coefficients are zerofor a block on one (or both) side of a boundary. For example, deblocksub-block boundary when all the transform coefficients for the block iszero.

In one example, according to the techniques herein, sub-CU boundary maybe deblocked based on whether all transform coefficients are zero forblocks (e.g. CU) on one (or both) side of a boundary and quantizationstep size is large (e.g QP greater than or equal to a threshold). Forexample, deblock sub-CU boundary when all the transform coefficients forthe CU is zero and QP is greater than a threshold.

In one example, according to the techniques herein, sub-block boundarymay be deblocked based on whether all transform coefficients are zerofor a block on one (or both) side of a boundary and quantization stepsize is large (e.g QP greater than or equal to a threshold). Forexample, deblock sub-block boundary when all the transform coefficientsfor the block is zero and QP is greater than a threshold.

In one example, according to the techniques herein, a block boundary maybe deblocked when Local Illumination Compensation (LIC) is used forblocks on one (or both) side of a boundary and all the transformcoefficients for that block is zero.

In one example, according to the techniques herein, all four boundariesof a block (i.e. left, right, top, bottom) a block boundary may bedeblocked when Local Illumination Compensation (LIC) is used for a blockand all the transform coefficients for that block is zero.

In one example, according to the techniques herein, a block boundary maybe deblocked when Local Illumination Compensation (LIC) is used forblocks on one (or both) side of a boundary and all the transformcoefficients for that block is zero and quantization step size is large(e.g QP greater than or equal to a threshold).

In one example, according to the techniques herein, all four boundariesof a block (i.e. left, right, top, bottom) a block boundary may bedeblocked when Local Illumination Compensation (LIC) is used for a blockand all the transform coefficients for that block is zero andquantization step size is large (e.g QP greater than or equal to athreshold).

In one example, according to the techniques herein, a block boundary maybe deblocked when cross component prediction is used for blocks on one(or both) side of a boundary and all the transform coefficients for thatblock is zero.

In one example, according to the techniques herein, a block boundary maybe deblocked when cross component prediction is used for blocks on one(or both) side of a boundary and all the transform coefficients for thatblock is zero and quantization step size is large (e.g QP greater thanor equal to a threshold).

In one example, according to the techniques herein, filter unit 216 maybe configured to perform deblocking according to multiple filteringpasses. In one example, a filtering pass may correspond toprocessing/constructing of all/subset of samples to be deblocked. Thenumber of processing/construction(s) for each sample in a given pass maycorrespond to the pass index/order. The subset of samples to bedeblocked may correspond to the pass index/order. In one example, everypass may correspond to processing/constructing of all of samples to bedeblocked exactly once. In one example of such a case, deblocked samplesfrom the previous iteration (as well as non-deblocked samples) may beused to construct deblocked samples for current iteration. In oneexample of such a case, deblocked samples from the previous and currentiteration (as well as non-deblocked samples) may be used to constructdeblocked samples. In this case, an ordering may be specified forconstructing deblocked samples. In one example, the number of iterationsmay be determined based on one or more of: the slice type; the blocksize; the skip flags of the current CU and its neighboring CUs; theprediction mode(Intra\inter) of the current CU and its neighboring CUs;the sample position to be de-blocked; whether d<β; and/or the strong orweak filter determination condition provided in JEM described above;distance of sample being deblocked (in number of samples) from boundary;block size(s) on each side of boundary; boundary strength; predictionmode used by blocks on each side of boundary; prediction mode of samplebeing deblocked; QP of sample being deblocked; block size correspondingto the sample being deblocked; block size corresponding to the samplesbeing used for deblocking; motion vectors for blocks on each side ofboundary being deblocked; motion vectors for sample being deblocked;and/or motion vectors for sample being used for deblocking. In oneexample, the iteration number may determine one or more filterparameters.

In an example, N-pass deblocking with a pre-determined deblockingsupport may be represented as:

-   -   For iterIdx=0 to (N−1)        -   For pos=posM to posN//samples being deblocked            -   temp[pos]=f_pos(samples values at pass iterIdx in                deblocking support)        -   For pos=posM to posN            -   Update sampleValue[pos] with temp[pos]    -   Where f_pos( ) is a linear transformation of the form:

${{f\_ pos}\left( {{samples}\mspace{14mu}{values}\mspace{14mu}{at}\mspace{14mu}{pass}\mspace{14mu}{iterIdx}\mspace{14mu}{in}\mspace{14mu}{deblocking}\mspace{14mu}{support}} \right)} = {\sum\limits_{m \in {{deblocking}\mspace{14mu}{support}}}^{\;}{{{coeff\_ pos}\lbrack m\rbrack}{{sampleValue}\left\lbrack {m,{iterIdx}} \right\rbrack}}}$

-   -   with the coeff_pos[ ] being an array of values dependent on        position pos of sample being deblocked. It should be noted, that        each sampleValue[ ] being used may be generated using deblocking        in the previous iteration. Also, the deblocking support does not        change from one iteration to next.    -   Performing an iteration-by-iteration analysis provides:        -   For iterIdx 0, the samples used are the non-deblocked            samples so for each pos:            -   temp [pos]=f_pos(samples values at pass 0 in deblocking                support).        -   For iterIdx 1,            -   temp[pos]=f_pos(samples values at pass 1 in deblocking                support).    -   Since f_pos( ) are linear transformations and the deblocking        support does not change, the above can be re-written as:        -   For iterIdx 1,            -   temp[pos]=g_pos(samples values at pass 0 in deblocking                support).    -   Where g_pos( ) is a linear transformation similar to f_pos( )        that depends on position pos, but with different coefficient        values.    -   This simplification can be performed recursively for each        iteration resulting in a filtering operations that are depends        only on the original sample values at iteration 0 leading to an        equivalent single-pass. Due to finite precision used in some        cases, the final coefficient values may be approximated leading        to an approximate single-pass representation of the multi-pass        filtering operation.

In one example, according to the techniques herein, filter unit 216 maybe configured to extend filter lines and the corresponding filtercoefficients. In one example, the sample lines to be filtered may beextended to eight at one side. In one example, for line 0 and line 1,the filter coefficients may be {1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1,1}/16; for line 2 and line 3, the filter coefficients may be {1, 1, 1,1, 1, 1, 1, 1}/8; and the filter coefficients for other lines may be {1,2, 2, 2, 1}/8, where line 0 denotes the nearest sample line to theboundary.

It should be noted that in JEM, the reconstructed samples are alwaysused to filter samples in the deblocking process. In one example,according to the techniques herein, filter unit 216 may be configured touse modified sample values resulting from deblocking to filter othersamples values. In one example, modified sample values may be used asinputs when filtering other samples value. In one example, a filteringorder may be specified. In one example, a filter order may performdeblocking from the farthest line from boundary to the nearest line.

As described above, deblocked samples are typically clipped to liewithin a range of values. The range of values may be based on theoriginal sample value and other parameters received in a bitstream. Inan example, the range of values is [original sample value−t_c, originalsample value+t_c]. In one example, according to the techniques herein,filter unit 216 may be configured to adjust a clipping function based onone or more of: the sample values in the last one or more rounds in themultiple pass deblocking; a QP value; a slice type; a current predictionmode(Intra/Inter); a current skip flag value; the intra prediction modesof samples to be deblocked; the motion vector of samples to bedeblocked; the sample position (e.g., different samples can usedifferent clipping functions); the CU position (e.g., different CU canuse different clipping functions); and/or any of the other conditionsdescribe above.

In one example, according to the techniques herein, filter unit 216 maybe configured to perform the filtering techniques described herein basedon a block size. For example, one or more of the filtering techniquesdescribed herein may be applied on a boundary, where the block sizesaround the boundary are larger than a threshold. For example, adetermination of whether to perform a filtering techniques may be asfollows: (1) check each set of 4×4 samples on each side of boundary(i.e., since minimum CU size is 4×4 luma samples); (2) if any one set of4×4 samples belongs to a CU with size larger than a thresholds (e.g.,64), the filtering technique will be performed on the current boundary.In one example, according to the techniques herein, filter unit 216 maybe configured to perform the filtering techniques described herein basedon one or more of: slice type; whether a block shape is rectangular;where a block shape is square; the skip flags of the current CU and itsneighboring CUs; the prediction mode(Intra\inter) of the current CU andits neighboring CUs; the sample position to be de-blocked.

In one example, according to the techniques herein, filter unit 216 maybe configured to perform the wider-stronger luma filtering as follows:

-   -   First, determine whether P-side makes use of large blocks as        follows, as:

bSidePisLargeBlk=((edge type is vertical and p ₀ belongs to block (e.g.CU) with width>=32)∥(edge type is horizontal and p ₀ belongs to block(e.g. CU) with height>=32))?TRUE:FALSE

-   -   Next, determine whether Q-side makes use of large blocks as        follows, as:

bSideQisLargeBlk=((edge type is vertical and q ₀ belongs to block (e.g.CU) with width>=32)∥(edge type is horizontal and q ₀ belongs to block(e.g. CU) with height>=32))?TRUE:FALSE

-   -   Next, derive the following variables:

d0P=bSidePisLargeBlk?XCalDQpLargeBlock(R[0]):XCalDQp(R[0])

d1P=bSidePisLargeBlk?XCalDQpLargeBlock(R[3]): XCalDQp(R[3])

d0Q=bSideQisLargeBlk?XCalDQqLargeBlock(R[0]):XCalDQq(R[0])

d1Q=bSideQLargeBlk?XCalDQqLargeBlock(R[3]):XCalDQq(R[3])

d0L=d0P+d0Q

d3L=d1P+d1Q

dL=d0L+d3L

-   -   Next, Condition1 and Condition2 are evaluated as follows:

Condition1=(dL<β)?TRUE:FALSE

Condition2=(xUseStrongFilteringLargeBlock(R[0],d0L,bSidePisLargeBlk,bSideQisLargeBlk)&&xUseStrongFilteringLargeBlock(R[3],d3L,bSidePisLargeBlk,bSideQisLargeBlk))?TRUE:FALSE

-   -   When Condition1, Condition2 and bSidePisLargeBlk is TRUE then a        wider-stronger filter is applied to the P-side of the boundary        (e.g. WS00P).    -   When Condition1, Condition2 and bSideQisLargeBlk is TRUE then a        wider-stronger filter is applied to the Q-side of the boundary.        (e.g. WS00Q)

In one example, Condition2 may be modified as follows:

Condition2=(When block on either side of boundary makes use of LocalIllumination Compensation and the CBF of that block is 0)?TRUE:((xUseStrongFilteringLargeBlock(R[0],d0L,bSidePisLargeBlk,bSideQisLargeBlk)&&xUseStrongFilteringLargeBlock(R[3],d3L,bSidePisLargeBlk,bSideQisLargeBlk))?TRUE:FALSE)

In one example, according to the techniques herein, filter unit 216 maybe configured to perform the chroma filtering as follows:

-   -   When, (edge type is vertical and p₀ belongs to CU with        width>=32)∥(edge type is horizontal and p₀ belongs to CU with        height>=32)&&(edge type is vertical and q₀ belongs to CU with        width>=32)∥(edge type is horizontal and q₀ belongs to CU with        height>=32), then a narrow strong filter (e.g NS00P and NS00Q)        may be used,    -   Otherwise, narrow weak filter may be used (e.g. NW00P and        NW00Q).

In one example, according to the techniques herein, filter unit 216 maybe configured to perform the chroma filtering as follows:

-   -   When, (p₀ belongs to CU with width>=32 and p₀ belongs to CU with        height>=32)∥(q₀ belongs to CU with width>=32 and q₀ belongs to        CU with height>=32), then a narrow strong filter (e.g NS00P and        NS00Q) may be used, Otherwise, narrow weak filter may be used        (e.g. NW00P and NW00Q).

In one example, according to the techniques herein, filter unit 216 maybe configured to perform deblock filtering according to the exampleflowchart illustrated in FIG. 10. In one example, filter unit 216 may beconfigured to perform deblock filtering according to the flowchartillustrated in FIG. 10 for luma samples. FIG. 10 illustrates an examplewhere for a current block (e.g., one of a P block or a Q block) one ofthe following types of deblocking may be applied: a wide strongerfilter, a strong filter, a weak filter, or no filtering. In one example,applying a wide stronger filter may include applying the WS00P and WS00Qfilters described above. In one example, applying a strong filter mayinclude applying the HEVC_P and HEVC_Q filters described above. In oneexample, applying a weak filter may include applying the weak filter inHEVC, described above as Weak Filter. As illustrated in FIG. 10, a widerstronger filter is applied at 408, no filter is applied at 412, a strongfilter is applied 416, and a weak filter is applied at 418 based onwhether: a large block condition is true at 402, a large block gradientcondition is true at 404, a large block strong filter condition is trueat 406, a gradient condition is true at 410, and a strong filtercondition is true at 414.

In one example, a large block condition may include whether thefollowing is true:

If((EDGE_VER&&(cur_block_width>=32∥adjacent_block_width>=32))∥(EDGE_HOR&&(cur_block_height>=32∥adjacent_block_height>=32)))

-   -   Where    -   EDGE_VER is a vertical boundary type,    -   EDGE_HOR is a horizontal boundary type,    -   cur_block_width is a current block width, e.g., in luma samples,    -   cur_block_height is a current block height, e.g., in luma        samples,    -   adjacent_block_width is an adjacent block width, e.g., in luma        samples, and    -   adjacent_block_height is an adjacent block height, e.g., in luma        samples.

In one example, a large block gradient condition may include whetherCondition 1, described above, is true. In one example, a large blockstrong filter condition may include whether one of the exampleCondition2, described above, is true.

In one example, a gradient condition may include whether d<β, where d isdetermined as follows:

d0P=XCalDQp(R[0])

d1P=XCalDQp(R[3])

d0Q=XCalDQq(R[0])

d1Q=XCalDQq(R[3])

d0=d0P+d0Q;

d3=d1P+d1Q;

d=d0+d3;

In one example, a strong filter condition may include whether thefollowing is true:

(xUseStrongFilteringLargeBlock(R[0],d0,false,false)&&xUseStrongFilteringLargeBlock(R[3],d3,false,false))?TRUE:FALSE

In one example, according to the techniques herein, filter unit 216 maybe configured to perform deblock filtering according to the exampleflowchart illustrated in FIG. 11. In one example, filter unit 216 may beconfigured to perform deblock filtering according to the flowchartillustrated in FIG. 11 for chroma samples. FIG. 11 illustrates anexample where for a current block (e.g., P block or a Q block) one ofthe following types of deblocking may be applied: a wide strongerfilter, or a weak filter. In one example, applying a wide strongerfilter may include applying the NS00P and NS00Q filters described above.In one example, applying a weak filter may include applying the as NW00Pand NW00Q filters described above. As illustrated in FIG. 11, a widerstronger filter is applied at 504, and a weak filter is applied at 506based on whether: a large block condition is true at 502.

In one example, a large block condition may include whether thefollowing is true:

If((EDGE_VER&&(cur_block_width>=32∥adjacent_block_width>=32))∥(EDGE_HOR&&(cur_block_height>=32∥adjacent_block_height>=32)))

-   -   Where    -   EDGE_VER is a vertical boundary type,    -   EDGE_HOR is a horizontal boundary type,    -   cur_block_width is a current block width, e.g., in chroma        samples,    -   cur_block_height is a current block height, e.g., in chroma        samples,    -   adjacent_block_width is an adjacent block width, e.g., in chroma        samples, and    -   adjacent_block_height is an adjacent block height, e.g., in        chroma samples.

In one example, filter unit 216 may be configured to perform deblockfiltering for chroma samples of a P block or a Q block) based on thefollowing condition set:

If((EDGE_VER&&(cur_Q_block_width>=TH_w))∥(EDGE_HOR&&(cur_Q_block_height>=TH_h)) is TRUE, apply NS00Q on Q samples.Otherwise, apply a weak filter on Q samples (e.g., NW00Q Q-side filter).

If((EDGE_VER&&(cur_P_block_width>=TH_w))∥(EDGE_HOR&&(cur_P_block_height>=TH_h))is TRUE, apply NS00P on P samples. Otherwise, apply a weak filter on Psamples (e.g., NW00P P-side filter).

-   -   Where    -   EDGE_VER is a vertical boundary type,    -   EDGE_HOR is a horizontal boundary type,    -   cur_Q_block_width is a current Q block width, e.g., in chroma        samples,    -   cur_Q_block_height is a current Q block height, e.g., in chroma        samples,    -   cur_P_block_width is a current P block width, e.g., in chroma        samples,    -   cur_P_block_height is a current P block height, e.g., in chroma        samples,    -   TH_w is a width threshold (e.g., 32 samples), and    -   TH_h is a height threshold (e.g., 32 samples).

It should be noted that a threshold value (e.g., TH_w and/or TH_h), insome examples may include a predefined value (e.g., 16 or 32), in someexamples may be signaled in a parameter set, in some examples may besignaling in a slice header, and in some examples may be the CTU size ina current portion of video.

Referring to FIG. 11, in one example, the large block condition may bereplaced with a luma filter condition. That is, for example, if a strongfilter is applied to a luma block, the wide stronger filter may beapplied to the collocated chroma block at 504, otherwise a weak filtermay be applied to the collocated chroma block at 506.

In one example, according to the techniques herein, filter unit 216 maybe configured to perform deblock filtering according to the exampleflowchart illustrated in FIG. 12. In one example, filter unit 216 may beconfigured to perform deblock filtering according to the flowchartillustrated in FIG. 12 for chroma samples. FIG. 12 illustrates anexample where for a current block (e.g., P block or a Q block) one ofthe following types of deblocking may be applied: a wide stronger filteror a weak filter. In one example, applying a wide stronger filter mayinclude applying the NS00P and NS00Q filters described above. In oneexample, applying a weak filter may include applying the as NW00P andNW00Q filters described above. As illustrated in FIG. 12, a widerstronger filter is applied at 608 and a weak filter is applied at 606based on whether: a large block condition is true at 602 and a largeblock strong filter condition is true at 604.

In one example, a large block condition may include whether thefollowing is true:

If((EDGE_VER&&(cur_block_width>=TH_w&&adjacent_block_width>=TH_w))∥(EDGE_HOR&&(cur_block_height>=TH_h∥adjacent_block_height>=TH_h)))

-   -   Where    -   EDGE_VER is a vertical boundary type,    -   EDGE_HOR is a horizontal boundary type,    -   cur_block_width is a current block width, e.g., in chroma        samples,    -   cur_block_height is a current block height, e.g., in chroma        samples,    -   adjacent_block_width is an adjacent block width, e.g., in chroma        samples, and    -   adjacent_block_height is an adjacent block height, e.g., in        chroma samples    -   TH_w is a width threshold (e.g., 32 samples), and    -   TH_h is a height threshold (e.g., 32 samples).

It should be noted that a threshold value (e.g., TH_w and/or TH_h), insome examples may include a predefined value (e.g., 16 or 32), in someexamples may be signaled in a parameter set, in some examples may besignaling in a slice header, and in some examples may be the CTU size ina current portion of video. In one example, a threshold value is largerthan 4.

In one example, a wider strong filter condition may include whether botha first condition and a second condition are true. That is, a strongfilter condition may be true when both the first condition and thesecond condition are true. In one example, a first condition may be truewhen d<β, where d is determined as follows:

dp0=xCalcDP(R _(C)[0]);

dq0=xCalcDQ(R _(C)[0]));

dp1=xCalcDP(R _(C)[1]);

dq1=xCalcDQ(R _(C)[1]);

d0=dp0+dq0;

d1=dp1+dq1;

d=d0+d1.

-   -   Where,    -   R_(C)[N] corresponds to chroma lines perpendicular to the edge        being deblocked and at distance N from the top of current chroma        segment being deblocked; and

In one example, a second condition may be true when

((abs(p3−p0)+abs(q3−q0)<(β>3))&&(d<(β>>2))&&(abs(q0−p0)<((tC*5+1)>>1)))

-   -   is true for R_(C)[0] and R_(C)[1].

In one example, a second condition may be true when

((abs(p3−p0)+abs(q3−q0)<(β>3))&&(d<(β>>2))&&(abs(q0−p0)<((tC*5+1)>>1)))

-   -   is true for R_(C)[0].

It should be noted that in one example, an edge is deblocked assegments, where the segment length may be a function of the smallestdimension allowed for a CU/TU/PU/subPU. Further, when 2×N and N×2 CU'sare the shortest and thinnest blocks allowed in chroma channel then thechroma segment length may be 2.

It should be noted that according to the chroma filtering above, twolines perpendicular to the edge being deblocked are processed as thebasic segment. In one example, four lines may be processed as the basicsegment. In one example, when four lines are processed as the basicsegment, a first condition may be true when d<β, where d is determinedas follows:

dp0=xCalcDP(R _(C)[0]);

dq0=xCalcDQ(R _(C)[0]));

dp3=xCalcDP(R _(C)[3]);

dq3=xCalcDQ(R _(C)[3]);

d0=dp0+dq0;

d3=dp3+dq3;

d=d0+d1.

Further, in one example, when four lines are processed as the basicsegment, a second condition may be true when

((abs(p3−p0)+abs(q3−q0)<(β>3))&&(d<(β>>2))&&(abs(q0−p0)<((tC*5+1)>>1)))

-   -   is true for R_(C)[0] and R_(C)[3].

As described above, in ITU-T H.265, the deblocking filter may be applieddifferently to CTU boundaries that coincide with slice and tileboundaries compared with CTU boundaries that do not coincide with sliceand tile boundaries. Specifically, in ITU-T H.265,slice_loop_filter_across_slices_enabled_flag enables/disables thedeblocking filter across CTU boundaries that coincide with top and leftslice boundaries. In one example, according to the techniques herein,when support samples of a deblocking filter exceeds a boundary (e.g.,picture/slice/tile) a deblocking filter using the support samples maynot be allowed. In one example, according to the techniques herein, whensupport samples of a deblocking filter exceeds a boundary (e.g.,picture/slice/tile) and using sample values across a boundary (e.g.,slice) is disabled, a padding operation may be used to generate supportsample values. For example, one of: a numeric scalar, circular,replicate, or symmetric padding may be used to generate a supportsample, where a numeric scalar padding operation pads according to aconstant value, a circular padding operation pads with circularrepetition of sample values, a replicate padding operation pads byrepeating border sample values, and a symmetric padding operation padswith a mirror reflection of sample values.

As described above, in ITU-T H.265, filtered values are clipped based ona value t_(C). In particular, for the Strong Filter in ITU-T H.265,described above, p_(i)′ values are clipped to (p_(i)−2*t_(C),p_(i)+2*t_(C)) and q_(i)′ values are clipped to (q_(i)−2*t_(C),q_(i)+2*t_(C)). As described above, in ITU-T H.265, the variable t_(C)′(and thus, the value of t_(C)) is determined based on the index Q whichis determined based on qP_(L), which is equal to: (QP_(Q)+QP_(P)+1)/2.In the some cases of video coding, (e.g., proposed techniques for codinghigh dynamic range (HDR) video), the values of the QP may be changed atCU-level or CTU-level. In these cases, the range of the clippingoperation provided in ITU-T H.265 based on index Q may be inadequate. Inone example, according to the techniques herein, different values oft_(C)′ may be determined for the P side samples and the Q side samples.That is, a P side t_(C)′ value, t_(CP)′, and a corresponding P sidet_(C) value, t_(CP), may be used to clip p_(i)′ values and a Q sidet_(C)′ value, t_(CQ)′, and a corresponding Q side t_(C) value, t_(CQ),may be used to clip q_(i)′ values. In one example, respective a P sideindex Q, Q_(p), and Q side index Q, Q_(q), may be determined bysubstituting qP_(L) with respective values of QP_(p) and QP_(Q) in the Qindex equation above. Thus, according to the techniques herein, p_(i)′values may be clipped to (p_(i)−2*t_(CP), p_(i)+2*t_(CP)) and q_(i)′values may be clipped to (q_(i)−2*t_(CQ), q_(i)+2*t_(CQ)). It should benoted that p_(i)′ values and q_(i)′ values may include filtered valuesgenerated according to any filter described herein. Thus, the techniquesfor clipping p_(i)′ values and q_(i)′ values based on respective t_(CP)and t_(CQ) may be applicable to any filter described herein.

It should be noted that in some cases, a video block (e.g., a CU) mayinclude internal TU boundaries and blocking artifacts may appear withinthe video block. In some cases, when a video block has a dimensionlarger than 64, deblocking of internal TU boundaries may be disabled. Inone example, according to the techniques herein, deblocking may beperformed along video block boundaries and also along any internal TUboundaries even in cases where a video block has a dimension larger than64.

Referring to FIGS. 5A-5B, some cases, a P block or a Q block may includemultiple objects. For example, referring to FIG. 5A, in one example,columns p₇ to p₃ may correspond to a first object, columns p₂ to p₀ maycorrespond to a second object, and columns q₀ to q₇ may correspond to athird object. In such a case, when samples in columns p₂ to p₀ arefiltered using samples in one or more column p₃ and q₀ to q₃, as supportsamples, the resulting filter sample values in columns p₂ to p₀ mayappear blurred. Further, in some cases deblocking may lead to smearingof dominant sample value(s) and/or introduce other visual artifacts.

As described above, a corresponding deblocked sample value, y[n] havingsupport samples, may be specified based on the following equation:

${y\lbrack n\rbrack} = {\sum\limits_{m = a}^{b}{{{coeff}\lbrack m\rbrack}{x\left\lbrack {n + m} \right\rbrack}}}$

-   -   Where,    -   A filter length is determined as abs(a−b+1);    -   coeff[m] provides a filter tap value (also referred to as a        filter coefficient);    -   x[n+m] provides input sample values corresponding to support        samples.

In one example, according to the techniques herein, in order to avoid ablurring or an artifact caused by distinct objects being included infiltered samples and support samples, one or more clipping operationsmay be applied to the term x[n+m]. In one example, the term x[n+m] maybe replaced with Clip3(x[n]−2*t_(C), x[n]+2*t_(C), x[n+m]).

-   -   In one example, the term x[n+m] may be modified such that a        support sample x[n+m] is excluded from the summation if        abs(x[n+m]−x[n]) is greater than a threshold. It should be noted        that in the case where coeff[m] corresponds to an average        distribution (i.e., coeff[m]=1/filter length, where filter        length equals (abs(a−b+1))), the coeff[m] is calculated as        1/(filter length−excluded samples). It should be noted that in        the case where coeff[m] corresponds to a Gaussian distribution        (i.e., Σ_(m=a) ^(b) coeff[m]=1, where filter length equals        abs(a−b+1)). In one example, the term x[n+m] may be modified        such that for every support sample x[n+m] where abs(x[n+m]−x[n])        that is greater than a threshold is satisfied, the value of        support sample x[n+m] is substituted with the value of x[n]. It        should be noted that the threshold value may be based on a        combination of one or more of: a predefined value (e.g., 2 or        4), a value signaled in a parameter set, a value signaled in a        slice header, a value based on a QP value (e.g., a QP value of a        current sample and/or a support sample), and/or a value based on        prediction information (e.g., an intra prediction mode and/or        motion information of a current sample and/or a support sample).

In one example, different filters may be applied at different samplepositions with respect to a boundary. For example, samples close to theboundary may be filtered using strong filters and samples far from theboundary may be filter using weak filters. For example, samples incolumn p0 to p1 may be filtered according to a strong filter and samplesin columns p2 to p4 may be filtered according to a weak filter. In oneexample, for chroma deblocking (or luma deblocking), a threshold (e.g.,2, 3, 4) may be used to such that if the positional distance between thecurrent sample and the sample nearest to the boundary is smaller thanthe threshold, a strong filter will be applied. In one example, thethreshold may be based on one or more of: block size on each side ofboundary (one or both); boundary strength; prediction mode used byblocks on each side of boundary; prediction mode of sample beingdeblocked; QP of sample being deblocked; block size corresponding to thesample being deblocked; block size corresponding to the samples beingused for deblocking; motion vectors for blocks on each side of boundarybeing deblocked; motion vectors for sample being deblocked; and/ormotion vectors for sample being used for deblocking.

It should be noted that in some cases of video coding, the luminancetransform coefficients (e.g., after quantization) corresponding to a CUmay be 0, and the CU may be divided into sub-PUs for motion compensation(e.g., ATMVP). In such a case, according to the techniques hereinluminance deblocking may be performed along subPU boundaries andfurther, along the CU boundaries in some examples.

It should be noted that in some cases of video coding, the chrominancetransform coefficients (e.g., after quantization) corresponding to a CUmay be 0, and the CU may be divided into sub-PUs for motion compensation(e.g., ATMVP). In such a case, according to the techniques hereinchrominance deblocking may be performed along sub-PU boundaries andfurther, along the CU boundaries in some examples.

As described above, in ITU-T H.265, for luma each of Bs, t_(C), β, and dare used to determine which filter type to apply (e.g., Strong Filter orWeak Filter). In particular, if d is less than β, a variable dStrong isdetermined as follows:

d_strong=abs(p ₃ −p ₀)+abs(q ₀ −q ₃)

Whether a Strong Filter or Weak Filter is applied is determined based onthe value of d_strong as follows:

If ((d_strong<(β>>3))&&(d<(β>>2))&&(abs(p ₀ −q ₀)<than (5*tC+1)>>1),

-   -   The Strong filter is applied;    -   Otherwise,    -   The Weak filter is applied.

In one example, according to the techniques herein dStrong may bedetermined as follows:

d_strong=(bSidePisLarge?max(abs(p ₀ −p ₇),max(abs(p ₃ −p ₀),abs(p ₇ −p₃))):abs(p ₃ −p ₀))+(bSideQisLarge?Max(abs(q ₀ −q ₇),max(abs(q ₃ −q₀),abs(q ₇ −q ₃))):abs(q ₃ −q ₀));

With respect to the deblocking filter implementations in JEM, when oneof the following conditions is valid, luma deblocking cannot beperformed in parallel as indicated below. That is, for example,deblocking may not be performed on both the left and right verticalboundaries of a block or the top and bottom horizontal boundaries of ablock in parallel. That is, deblocking cannot be performed on two blockboundaries in parallel, as the filtering process for one boundary mayinvolve the samples deblocked by the filtering process for anotherboundary. Thus, samples at the center of a block may be covered by bothof the deblocking filters at each corresponding edge.

If (Cur_EDGE_VER&& cur_block_width==4), no parallel deblocking ofcurrent block vertical boundaries;

If (Cur_EDGE_VER&& adjacent_block_width==4), no parallel deblocking ofadjacent block vertical boundaries;

If (Cur_EDGE_HOR&& cur_block_height==4), no parallel deblocking ofcurrent block horizontal boundaries;

If (Cur_EDGE_HOR&& adjacent_block_width==4), no parallel deblocking ofadjacent block horizontal boundaries;

-   -   Where,    -   Cur_EDGE_VER is a current vertical boundary,    -   Cur_EDGE_HOR is a current horizontal boundary,    -   cur_block_width is a current block width, e.g., in luma samples,    -   cur_block_height is a current block height, e.g., in luma        samples,    -   adjacent_block_width is an adjacent block width, e.g., in luma        samples, and    -   adjacent_block_height is an adjacent block height, e.g., in luma        samples.

In one example, according to the techniques herein, for each of theconditions above, deblocking may be performed on luma samples at aboundary as follows:

If (Cur_EDGE_VER&&cur_block_width==4 && adjacent_block_width>4), forCur_EDGE_VER only perform deblocking on adjacent block samples;

If (Cur_EDGE_VER&&cur_block_width==4&&adjacent_block_width==4), forCur_EDGE_VER do not perform deblocking;

If (Cur_EDGE_VER&&cur_block_width>4 && adjacent_block_width==4), forCur_EDGE_VER only perform deblocking on current block samples;

If (Cur_EDGE_VER&&cur_block_width>4 && adjacent_block_width>4), forCur_EDGE_VER perform deblocking on current block samples and adjacentblock samples;

If (Cur_EDGE_HOR&&cur_block_height==4 && adjacent_block_height>4), forCur_EDGE_HOR only perform deblocking on adjacent block samples;

If (Cur_EDGE_HOR&&cur_block_height==4 && adjacent_block_height==4), forCur_EDGE_HOR do not perform deblocking;

If (Cur_EDGE_HOR&&cur_block_height>4 && adjacent_block_height==4), forCur_EDGE_HOR only perform deblocking on current block samples;

If (Cur_EDGE_HOR&&cur_block_height>4 && adjacent_block_height>4), forCur_EDGE_HOR perform deblocking on current block samples and adjacentblock samples.

In a manner similar to that described above, for chroma deblocking,cases where parallel deblocking are limited occur when respective blockcur_block_height, adjacent_block_height, cur_block_width,adjacent_block_width are equal to the threshold of 2. Thus, according tothe techniques herein, for chroma samples, deblocking may be performedas described above where the threshold value 4 is replaced with thethreshold value of 2 in the conditional statements.

In one example, according to the technique herein, instead of notperforming deblocking on an edge for a block having dimension less thanor equal to a threshold value, a narrower filter may be applied tosamples at the edge. For example, in the case where (Cur_EDGE_VER &&cur_block_width==4 && adjacent_block_width>4), deblocking may beperformed as follows:

-   -   For Cur_EDGE_VER perform deblocking on adjacent block samples        according filter width and perform deblocking on the one        adjacent column of samples at Cur_EDGE_VER for the current        block.

In a similar manner, a narrower filter may be applied to samples at theedge for each of the cases described above. Thus, in general, accordingto the techniques herein, a video encoder (and/or video decoder) may beconfigured to determine when parallel deblocking is limited, forexample, due to overlapping deblocking filters (e.g., a filter widthbeing greater than half the block's width (or height)), and modify whichsamples which would otherwise be deblocked. It should be noted that insome cases, parallel deblocking may be limited based on the sampleswhich are used for deblocking support. According to the techniquesherein, a video encoder (and/or video decoder) may be configured todetermine when parallel deblocking is limited do to samples in a blockmay being used for deblocking support for multiple deblocking filters.

As described above, for a F4P P-side filter, one of the computationsincludes:

p ₀′=(p ₇ +p ₆ +p ₅ +p ₄ +p ₃ +p ₂ +p ₁+2*p ₀ +q ₀ +q ₁ +q ₂ +q ₃ +q ₄+q ₅ +q ₆+8)>>4

It should be noted that if a q-side is size 8 and the opposite edge fromthe current edge makes use of strong HEVC filter then the samples q₅ andq₆ may be modified by the strong HEVC deblocking operation for theopposite side. Parallel processing cannot occur of deblocking edges thatare parallel to each other. In one example, to prevent this, the p-sideshould use long filters (i.e., stronger filters) only if the q-sidelength (perpendicular to the edge) is greater than or equal to 16. Thiscondition (e.g., LargeBlk condition) be checked in one of the followingways:

-   -   LargeBlk condition: (Both sides of the edge have length        perpendicular to the edge>=16)?TRUE:FALSE;    -   LargeBlk condition: (Both sides of the edge have length        perpendicular to the edge>=32)?TRUE:FALSE;    -   OR    -   LargeBlk condition: (Large block side of the edge has length        perpendicular to the edge>=32 AND other block side of the edge        has length perpendicular to the edge>=16)?TRUE: FALSE. Note,        when both block size length is same then we would require that        both be >=32. Wider-stronger filters are only used for side with        length>=32.

In one example, according to the techniques herein, a set of deblockingfilters may make use of a bilinear operation. In one example, blockboundary samples p_(i) and q_(i) for i=0 to S−1 are replaced by linearinterpolation as follows

p _(i)′=(f _(i)*Middle_(s,t)+(64−f _(i))*P _(s)+32)>>6), clipped to p_(i) ±tc

q _(i)′=(g _(i)*Middle_(s,t)+(64−g _(i))*Q _(t)+32)>>6), clipped to q_(i) ±tc

In one example, f_(i), Middle_(s,t), P_(s), g_(i), and Q_(t) may bedetermined as provided in Table 1.

TABLE 1 s, t (p-side, q-side) Filter kernels 7, 7 f_(i) = 59 − i * 9,can also be described as f = {59, 50, 41, 32, 23, 14, 5} g_(i) = 59 −i * 9, can also be described as g = {59, 50, 41, 32, 23, 14, 5}Middle_(7, 7) = (2* (p₀ + q₀) + p₁ + q₁ + p₂ + q₂ + p₃ + q₃ + p₄ + q₄ +p₅ + q₅ + p₆ + q₆ + 8) >> 4 P₇ = (p₆ + p₇ + 1) >> 1, Q₇ = (q₆ +q₇ + 1) >> 1 5, 5 f_(i) = 58 − i * 13, can also be described as f = {58,45, 32, 19, 6} g_(i) = 58 − i * 13, can also be described as g = {58,45, 32, 19, 6} Middle_(5, 5) = (2 * (p₀ + q₀ + p₁ + q₁ + p₂ + q₂) + p₃ +q₃ + p₄ + q₄ + 8) >> 4 P₅ = (p₄ + p₅ + 1) >> 1, Q₅ = (q₄ + q₅ + 1) >> 13, 3 f_(i) = 53 − i * 21, can also be described as f = {53, 32, 11}g_(i) = 53 − i* 21, can also be described as g = {53, 32, 11}Middle_(3, 3) = (3 * (p₀ + q₀ + p₁ + q₁) + 2 * (p₂ + q₂) + 8) >> 4 P₃ =(p₂ + p₃ + 1) >> 1, Q₃ = (q₂ + q₃ + 1) >> 1 7, 5 f_(i) = 59 − i * 9, canalso be described as f = {59, 50, 41, 32, 23, 14, 5} g_(i) = 58 − i *13, can also be described as g = {58, 45, 32, 19, 6} Middle_(7, 5) =(2 * (p₀ + q₀ + q₁ + q₂) + p₁ + p₂ + p₃ + q₃ + p₄ + q₄ + p₅ + p₆ + 8) >>4 P₇ = (p₆ + p₇ + 1) >> 1, Q₅ = (q₄ + q₅ + 1) >> 1 7, 3 f_(i) = 59 − i *9, can also be described as f = {59, 50, 41, 32, 23, 14, 5} g_(i) = 53 −i * 21, can also be described as g = {53, 32, 11} Middle_(7, 3) = (2 *(p₀ + q₀) + q₀ + 2 * (q₁ + q₂) + p₁ + q₁ + p₂ + p₃ + p₄ + p₅ + p₆ +8) >> 4 P₇ = (p₆ + p₇ + 1) >> 1, Q₃ = (q₂ + q₃ + 1) >> 1 5, 3 f_(i) = 58− i * 13, can also be described as f = {58, 45, 32, 19, 6} g_(i) = 53 −i * 21, can also be described as g = {53, 32, 11} Middle_(5, 3) = (2 *(p₀ + q₀ + p₁ + q₁ + p₂ + q₂) + q₀ + q₁ + p₃ + p₄ + 8) >> 4 P₅ = (p₄ +p₅ + 1) >> 1, Q₃ = (q₂ + q₃ + 1) >> 1 5, 7 g_(i) = 59 − i * 9, can alsobe described as g = {59, 50, 41, 32, 23, 14, 5} f_(i) = 58 − i * 13, canalso be described as f = {58, 45, 32, 19, 6} Middle_(5, 7) = (2 * (q₀ +p₀ + p₁ + p₂) + q₁ + q₂ + q₃ + p₃ + q₄ + p₄ + q₅ + q₆ + 8) >> 4 Q₇ =(q₆ + q₇ + 1) >> 1, P₅ = (p₄ + p₅ + 1) >> 1 3, 7 g_(i) = 59 − i * 9, canalso be described as g = {59, 50, 41, 32, 23, 14, 5} f_(i) = 53 − i *21, can also be described as f = {53, 32, 11} Middle_(3, 7) = (2 * (q₀ +p₀) + p₀ + 2 * (p₁ + p₂) + q₁ + p₁ + q₂ + q₃ + q₄ + q₅ + q₆ + 8) >> 4 Q₇= (q₆ + q₇ + 1) >> 1, P₃ = (p₂ + p₃ + 1) >> 1

With respect to Table 1, it should be noted that for 7,5; 7,3; 5,3; 5,7;and 3,7 the weights of p_(i) and q_(i) for Middle are not the same andderived from 7,7 by adding additional terms.

In one example, according to the techniques herein, a set of deblockingfilters may make use of a bilinear operation if either side is greaterthan or equal to 32.

In one example, according to the techniques when either side is greaterthan or equal to 32 bilinear deblocking may be performed as provided inTable 2.

TABLE 2 P-side Q-side s, t >=32 >=32 7, 7 >=32   <32 7, 3   <32 >=32 3,7

In one example, according to the techniques when either side is greaterthan or equal to 32 bilinear deblocking may be performed as provided inTable 3.

TABLE 3 P-side Q-side s, t >=32 >=32 7, 7 >=32   <32 7, 5   <32 >=32 5,7

In one example, according to the techniques when either side is greaterthan or equal to 32 bilinear deblocking may be performed as provided inTable 4.

TABLE 4 P-side Q-side s, t >=32 >=32 5, 5 >=32   <32 5, 3   <32 >=32 3,5

In one example, according to the techniques when either side is greaterthan or equal to 32 bilinear deblocking may be performed as provided inTable 5.

TABLE 5 P-side Q-side s, t >=32 >=32 7, 7 >=32   <32 7, 3   <32 >=32 3,7   <32   <32 3, 3

In one example, according to the techniques when either side is greaterthan or equal to 32 bilinear deblocking may be performed as provided inTable 6.

TABLE 6 P-side Q-side s, t >=32 >=32 7, 7 >=32   <32 7, 5   <32 >=32 5,7   <32   <32 5, 5

In one example, according to the techniques when either side is greaterthan or equal to 32 bilinear deblocking may be performed as provided inTable 7.

TABLE 7 P-side Q-side s, t >=32 >=32 5, 5 >=32   <32 5, 3   <32 >=32 3,5   <32   <32 3, 3

In one example, according to the techniques herein, a set of deblockingfilters may make use of a bilinear operation if either side is greaterthan or equal to 16. In such a case, in Tables 2-7, 32 may be replacedwith 16. In one example for Tables 5, 6, and 7, the last column (s,t) ofrows with P-side length not equal to Q-side length may make use of(3,3),(5,5),(3,3) respective filtering. In one example, whether a set ofdeblocking filters makes use of a bilinear operation may be additionallyconditioned on whether a strong filter condition is true. For example,any of the strong filter conditions described above. In one example,whether a set of deblocking filters makes use of a bilinear operationmay be additionally conditioned as follows:

-   -   The variables dpq0, dpq3, dp, dq, and d are derived as follows:

dp0=abs(p _(2,0)−2*p _(1,0) +p _(0,0))

dp3=abs(p _(2,3)−2*p _(1,3) +p _(0,3))

dq0=abs(q _(2,0)−2*q _(1,0) +q _(0,0))

dq3=abs(q _(2,3)−2*q _(1,3) +q _(0,3))

-   -   -   and then,        -   if (p side is greater than or equal to 16)

dp0=(dp0+abs(p _(5,0)−2*p _(4,0) +p _(3,0))+1)>>1

dp3=(dp3+abs(p _(5,3)−2*p _(4,3) +p _(3,3))+1)>>1

-   -   -   if (q side is greater than or equal to 16)

dq0=(dq0+Abs(q _(5,0)−2*q _(4,0) +q _(3,0))+1)>>1

dq3=(dq3+Abs(q _(5,3)−2*q _(4,3) +q _(3,3))+1)>>1

dpq0=dp0+dq0

dpq3=dp3+dq3

dp=dp0+dp3

dq=dq0+dq3

d=dpq0+dpq3

-   -   When d is less than β, the following ordered steps apply:        -   The variable dpq is set equal to 2*dpq0.

sp ₃=abs(p ₃ −p ₀)

-   -   -   if (p side is greater than or equal to 16)

sp ₃=(sp ₃+abs(p ₇ −p ₃)+1)>>1

sq ₃=abs(q ₃ −q ₀)

-   -   -   -   if (q side is greater than or equal to 16)

sq ₃=(sq ₃+abs(q ₇ −q ₃)+1)>>1

StrongFilterCondition=(dpq is less than (β>>2),sp ₃ +sq ₃ is less than(β>>3), and abs(p ₀ −q ₀) is less than (5*t _(C)+1)>>1)?TRUE:FALSE

It should be noted that in some examples: control parameter values forluma and chroma (e.g., β, tC, etc.) may not be the same and signaledusing different set of syntax elements; control parameter values forchroma may be derived from control parameter values for luma; deblockingmay be performed only on subPU edges that align with 8×8 (luma) and 4×4(chroma) boundary; deblocking of edges of a current block may be basedon the usage of linear model (LM) chroma; deblocking of edges of acurrent block may be based on the usage of separate partitioning trees;deblocking of edges of a current block may be based on the usage ofpulse code modulation (PCM); and/or deblocking of edges of a currentblock may be based on the usage of transform quantization bypass mode.It should be noted that PCM is a lossless coding mode for a block ofsamples. In an example of PCM coding, samples are directly representedby a predefined number of bits. The bit depth used for PCM may besignaled in parameter set(s).

With respect to deblocking of edges of a current block based on theusage of LM chroma and/or deblocking of edges of a current block may bebased on the usage of separate partitioning trees, in one example,deblock may be performed on edges of current block when LM chroma isused for a chroma block and/or separate trees is used for luma andchroma and/or transform coefficients received is zero. With respect toin one example, for separate trees deblocking may be performed only on achroma edge (e.g. TU edges, PU edges, subPU edges, CU edges) co-incidentwith a 4×4 chroma grid.

In one example, when the large block condition is not TRUE and thestrong filter condition is TRUE then NS00P and NS00Q are used to deblockthe edge.

In one example, when the large block condition is not TRUE and thestrong filter condition is TRUE then the (s,t)=3,3 filters are used todeblock the edge.

It should be noted that in some cases, a deblocking boundary may includea horizontal CTU boundary. For example, referring to FIG. 5B, in somecases, samples p_(y,x) may be included in the CTU which is above the CTUincluding samples q_(y,x). For purposes of coding the top line in acurrent CTU, a typical video coder implementation stores N rows ofsamples in the bottom lines of the CTU above the current CTU. Forexample, in the case where the deblocking boundary in FIG. 5B is a CTUboundary, a video coder stores values p_(x,0) for performing intraprediction coding of line q_(x,0). A CTU line buffer refers to the linesof sample values above the current CTU which are stored for coding thecurrent CTU. As the number of lines included in the CTU line bufferincreases, memory costs of an video coder implementation increases. Itshould be noted that in some cases, data corresponding to sample valuesis also stored (e.g., prediction mode (and associated information e.g.,intra prediction mode, bi-pred/uni-pred, motion vectors, referenceindex, etc.), block size, coefficient coding flags, etc.) Thus, in orderto avoid increasing implementation costs, it is desirable to avoidincreasing the number of lines included in the CTU line buffer solelyfor purposes of performing deblocking. For example, if all codingfeatures of a proposed video coding standard require a CTU line bufferto store four lines of sample values, a deblocking filter that requiresthe CTU line buffer to be increased to store seven lines of samplevalues would increase implementation costs.

As described above, JEM describes the coding features that are undercoordinated test model study by the JVET as potentially enhancing videocoding technology beyond the capabilities of ITU-T H.265. Further, inresponse to a “Joint Call for Proposals on Video Compression withCapabilities beyond HEVC,” jointly issued by VCEG and MPEG, multipledescriptions of video coding were proposed by various groups at the 10thMeeting of ISO/IEC JTC1/SC29/WG11 16-20 Apr. 2018, San Diego, Calif. Asa result of the multiple descriptions of video coding, a draft text of avideo coding specification is described in “Versatile Video Coding(Draft 1),” 10th Meeting of ISO/IEC JTC1/SC29/WG11 16-20 Apr. 2018, SanDiego, Calif., document JVET-J1001-v2, which is incorporated byreference herein, and referred to as JVET-J1001. “Versatile Video Coding(Draft 2),” 11th Meeting of ISO/IEC JTC1/SC29/WG11 10-18 Jul. 2018,Ljubljana, S I, document JVET-K1001-v4, which is incorporated byreference herein, and referred to as JVET-K1001, is an update toJVET-J1001. Proposed techniques in each of JVET-J1001 and JVET-K1001 arebeing implemented and evaluated using a Test Model (VTM) and BenchmarkSet (BMS). The existing deblocking filter in BMS modifies up to threesamples perpendicular to edges.

“CE2-related: Longer Tap Deblocking Filter,” 11th Meeting of ISO/IECJTC1/SC29/WG11 10-18 Jul. 2018, Ljubljana, S I, document JVET-K0369-r3which is referred to herein as JVET-K0369, describes a deblocking filterwhich modifies up to seven samples perpendicular to edges beingdeblocked. Further, in order to restrict the CTU line buffer size, thefilter described in JVET-K0369 restricts the filtering operations forhorizontal edges overlapping with CTU boundaries. In particular,JVET-K0369 describes a deblocking filter which modifies sample valuesaccording to Table 8A and provides where for the horizontal edges whichoverlap with the CTU boundaries, the deblocking filter is modified asillustrated in Table 8B.

TABLE 8A Filter coefficients Output {p₇, p₆, p₅, p₄, p₃, p₂, p₁, p₀,Input pixel q₀, q₁, q₂, q₃, q₄, q₅, q₆, q₇} pixels p₆′ {6, 3, 1, 1, 1,1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0} p₇ to q₀ p₅′ {5, 1, 3, 1, 1, 1, 1, 1,1, 1, 0, 0, 0, 0, 0, 0} p₇ to q₁ p₄′ {4, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1,0, 0, 0, 0, 0} p₇ to q₂ p₃′ {3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, 0,0, 0} p₇ to q₃ p₂′ {2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0} p₇to q₄ p₁′ {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, 0} p₇ to q₅ p₀′{1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0} p₇ to q₆ q₀′ {0, 1, 1,1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1} p₆ to q₇ q₁′ {0, 0, 1, 1, 1, 1,1, 1, 1, 3, 1, 1, 1, 1, 1, 1} p₅ to q₇ q₂′ {0, 0, 0, 1, 1, 1, 1, 1, 1,1, 3, 1, 1, 1, 1, 2} p₄ to q₇ q₃′ {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3,1, 1, 1, 3} p₃ to q₇ q₄′ {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1,4} p₂ to q₇ q₅′ {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5} p₁ toq₇ q₆′ {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 6} p₀ to q₇

TABLE 8B Filter coefficients Output {p₇, p₆, p₅, p₄, p₃, p₂, p₁, p₀,Input pixel q₀, q₁, q₂, q₃, q₄, q₅, q₆, q₇} pixels p₂′ {0, 0, 0, 0, 6,3, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0} p₃ to q₄ p₁′ {0, 0, 0, 0, 5, 1, 3, 1,1, 1, 1, 1, 1, 1, 0, 0} p₃ to q₅ p₀′ {0, 0, 0, 0, 5, 1, 1, 2, 1, 1, 1,1, 1, 1, 1, 0} p₃ to q₆ q₀′ {0, 0, 0, 0, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1,1, 1} p₃ to q₇ q₁′ {0, 0, 0, 0, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1} p₃to q₇ q₂′ {0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2} p₃ to q₇ q₃′{0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3} p₃ to q₇ q₄′ {0, 0, 0,0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4} p₂ to q₇ q₅′ {0, 0, 0, 0, 0, 0,1, 1, 1, 1, 1, 1, 1, 3, 1, 5} p₁ to q₇ q₆′ {0, 0, 0, 0, 0, 0, 0, 1, 1,1, 1, 1, 1, 1, 3, 6} p₀ to q₇

It should be noted that modifying the deblocking filter are provided inJVET-K0369 for horizontal edges overlapping with CTU boundaries does notreduce the line buffer requirements for chroma sample values. Further,as illustrated in Table 8B, in addition to “zeroing out” filtercoefficients for p₇ to p₄, filter coefficient values are changed for p₃to q₇. Thus, JVET-K0369 requires storing additional filter sets to beused for filtering CTU boundaries, which requires additional memory forstoring the coefficients.

In one example, according to the techniques herein, the usage of a longtap filter, which may include a filter that modifies and/or has a filtersupport that includes at least three or more lines from p_(x,0) top_(x,i) may be limited. In one example, for luma and/or chromadeblocking if the following condition is met (EDGE_TYPE is EDGE_HOR &&Current Boundary is align with a CTU boundary), a long tap filter is notapplied for side P, where EDGE_TYPE is EDGE_HOR indicates the currentboundary is a horizontal boundary. In one example, for luma and/orchroma deblocking if the following condition is met (EDGE_TYPE isEDGE_HOR && curPos.y % CTUSize in luma samples==0), a long tap filter isnot applied for P, where, curPos.y is the vertical luma position of thecurrent block to be deblocked. In one example, for luma and/or chromadeblocking if the following condition is met (EDGE_TYPE is EDGE_HOR &&curPosC.y % CTUSize in chroma samples==0), a long tap filter is notapplied for P, where, curPosC.y is the vertical chroma position of thecurrent block to be deblocked. In one example, for luma and/or chromadeblocking if the following condition is met (EDGE_TYPE is EDGE_HOR &&Current Boundary is align with a CTU boundary), a long tap filter is notapplied for side Q and side P. In one example, for luma and/or chromadeblocking if the following condition is met (EDGE_TYPE is EDGE_HOR &&curPos.y % CTUSize in luma samples==0), a long tap filter is not appliedfor side Q and side P. In one example, for luma and/or chroma deblockingif the following condition is met (EDGE_TYPE is EDGE_HOR && curPosC.y %CTUSize in chroma samples==0), a long tap filter is not applied for sideQ and side P. In one example, when a long tap filter is not applied,another filter which modifies fewer samples and/or includes a filtersupport utilizing fewer lines from p_(x,0) to p_(x,i) (e.g., one, two,or three lines). For example, a weak or strong filters described hereinmay be applied in cases where a long tap filter is not allowed to beapplied. It should be noted that, as provided in ITU-T H.265, the %operand is the modulus operand which provides the remainder of x dividedby y.

In one example, when a long tap filter is not applied, sample valuesbeyond a target line buffer threshold (e.g., three or four) may be madenot-available and predetermined values may be used for the correspondingsample positions. Table 9 illustrates an example where a long tap filterincludes the long tap filter described above with respect to Table 8Aand a target line buffer threshold is four. Thus, sample values for p₄to mare not-available. As illustrated in Table 9, values for p₄ to marenot modified for deblocking. Further, as illustrated in Table 9, p₄ top₇ the filter coefficients are indicated an NA, which indicates that asample value for each of p₄ to p₇ is not available in the line buffer.In one example, for each p₄ to p₇, the sample value may be set to thesample value of p₃ and the filter coefficients in Table 8A may be usedfor deriving modified sample value for p₃′ to q₂′.

TABLE 9 Filter coefficients Output {p₇, p₆, p₅, p₄, p₃, p₂, p₁, p₀,Input pixel q₀, q₁, q₂, q₃, q₄, q₅, q₆, q₇} pixels p₃′ {NA, NA, NA, NA,3, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0} p₇ to q₃ p₂′ {NA, NA, NA, NA, 1, 3,1, 1, 1, 1, 1, 1, 1, 0, 0, 0} p₇ to q₄ p₁′ {NA, NA, NA, NA, 1, 1, 3, 1,1, 1, 1, 1, 1, 1, 0, 0} p₇ to q₅ p₀′ {NA, NA, NA, NA, 1, 1, 1, 2, 1, 1,1, 1, 1, 1, 1, 0} p₇ to q₆ q₀′ {NA, NA, NA, NA, 1, 1, 1, 1, 2, 1, 1, 1,1, 1, 1, 1} p₆ to q₇ q₁′ {NA, NA, NA, NA, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1,1} p₅ to q₇ q₂′ {NA, NA, NA, NA, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2} p₄to q₇ q₃′ {NA, NA, NA, NA, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3} p₃ to q₇q₄′ {NA, NA, NA, NA, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4} p₂ to q₇ q₅′ {NA,NA, NA, NA, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5} p₁ to q₇ q₆′ {NA, NA,NA, NA, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 3, 6} p₀ to q₇

Further, in one example, values derived from sample values that areavailable may be used for the corresponding sample positions. In oneexample, for each p₄ to p₇, the sample value may be set to the averagesample value of p₃ and p₂ and the filter coefficients in Table 8A may beused for deriving modified sample value for p₃′ to q₂′.

In one example, when a long tap filter is not applied, the filteringprocess may be modified based on the position of a sample beingdeblocked (e.g., based on whether the sample value is above the CTUhorizontal boundary OR within a certain distance of the CTU horizontalboundary) and a corresponding filter which do not access/deblock samplesbeyond the target line buffer threshold may be selected. For example,with respect to the example illustrated in Table 9, for p₃′ and p₂′different rules may be applied from deriving sample values for p₄ to p₇.

In one example, when a long tap filter is not applied, the controlprocess may be modified based on the position of a sample beingdeblocked and a corresponding filter which do not access/deblock samplesbeyond the target line buffer threshold may be selected. For example,(s=3, t=7) filter of Table 1 for luma, (s=3, t=5) filter of Table 1 forluma, F1P for luma, and/or chroma weak filter for chroma may beselected.

In one example, when a long tap filter is not applied, the deblockinggrid may be changed, so that samples beyond the target line bufferthreshold are not accessed/deblocked. For example, the deblocking gridmay be moved so that the horizontal edge is at a distance of 4 below thehorizontal CTU edge.

As described above, in ITU-T H.265, based on the QP values used forcoding the CBs including video blocks P and Q (which may be referred toas QP_(P) and QP_(Q)), variables t_(C)′ and β′ are determined. Thederivation of the index Q for the luma channel is described above. Forthe chroma channel, ITU-T H.265, provides if the chroma is equal to4:2:0, a variable Qp_(C) is determined as specified in the tableillustrated in FIG. 13 based on the index qPi as follows:

qPi=((Qp _(Q) +Qp _(P)+1)>>1)+cQpPicOffset

-   -   where,        -   cQpPicOffset is a variable specifying the picture-level            chroma quantization parameter offset, and

cQpPicOffset=pps_cb_qp_offset for Cb, and

cQpPicOffset=pps_cr_qp_offset for Cr

It should be noted that in ITU-T H.265, if the chroma format is equal to4:2:2 or 4:4:4, QpC is set equal to Min(qPi, 51).

For Chroma, t_(c)′ is determined using the table illustrated in FIG. 6Aand the index Q which is determined as follows for t_(c)′:

Q=Clip3(0,53,Q _(pc)+2*+(slice_tc_offset_div 2<<1))

The proposed techniques in each of JVET-J1001 and JVET-K1001 providewhere separate partitioning trees may be used for partitioning the lumaand chroma channels. In cases where separate partitioning trees are usedfor partitioning the luma and chroma channels, it may be useful toincrease the amount to which a QP value for the chroma channel can bevaried with respect to a QP value for the luma channel. That is, forexample, respective QP offset values, which may be signaled on a slicelevel, for the each component of the chroma channel may be increased. Itshould be noted that ITU-H.265 provides the following chroma channel QPoffset syntax elements:

-   -   pps_cb_qp_offset and pps_cr_qp_offset specify the offsets to the        luma quantization parameter Qp′Y used for deriving Qp′Cb and        Qp′Cr, respectively. The values of pps_cb_qp_offset and        pps_cr_qp_offset shall be in the range of −12 to +12, inclusive.        When ChromaArrayType is equal to 0, pps_cb_qp_offset and        pps_cr_qp_offset are not used in the decoding process and        decoders shall ignore their value.    -   slice_cb_qp_offset specifies a difference to be added to the        value of pps_cb_qp_offset when determining the value of the        Qp′Cb quantization parameter. The value of slice_cb_qp_offset        shall be in the range of −12 to +12, inclusive. When        slice_cb_qp_offset is not present, it is inferred to be equal        to 0. The value of pps_cb_qp_offset+slice_cb_qp_offset shall be        in the range of −12 to +12, inclusive.    -   slice_cr_qp_offset specifies a difference to be added to the        value of pps_cr_qp_offset when determining the value of the        Qp′Cr quantization parameter. The value of slice_cb_qp_offset        shall be in the range of −12 to +12, inclusive. When        slice_cr_qp_offset is not present, it is inferred to be equal        to 0. The value of pps_cr_qp_offset+slice_cr_qp_offset shall be        in the range of −12 to +12, inclusive.

Changes to the derivation of chroma QP values may effect chroma channeldeblocking in cases where deblocking parameters are based on a QP value.According to the techniques herein the derivation of deblockingparameters based QP value(s) may be modified, e.g., in cases whereseparate partitioning trees may be used for partitioning the luma andchroma channels.

In one example according to the techniques herein, cQpPicOffset may bederived as follows:

cQpPicOffset=pps_cb_qp_offset+slice_cb_qp_offset for Cb, and

cQpPicOffset=pps_cr_qp_offset+slice_cr_qp_offset for Cr

In one example, a CU level chroma QP offset value may be signaled (fore.g., during a palette mode coding). The chroma QP derivation used fordeblocking may make use of the CU level chroma QP offset. For example,if the variables CuQpOffsetCb and CuQpOffsetCr represent Cb and Croffset, then the chroma QP offset may be derived as:

cQpPicOffset=pps_cb_qp_offset+slice_cb_qp_offset+CuQpOffset_(Cb) for Cb

cQpPicOffset=pps_cr_qp_offset+slice_cr_qp_offset+CuQpOffset_(Cr) for Cr

In some cases an additional luma and chroma QP offset value may be usedfor blocks undergoing a type of processing (e.g., adaptive colortransform). These QP offsets may be used for deriving the QP for lumaand chroma. As a result, the deblocking processes may depend on theadditional luma and chroma QP offsets.

In some examples, when separate partitioning trees are used forpartitioning the luma and chroma channels, the chroma QP value may becomputed based on partition tree type. For example, in one example, thechroma QP value may be determined as follows:

qPi=((Qp _(blk_Q) +QP _(blk_P)+1)>>1)+cQpPicOffset

-   -   where, Qp_(blk_P), Qp_(blk_Q) are luma quantization parameters        corresponding to chroma block on P-side and chroma block on        Q-side respectively.

In one example, Qp_(blk_P) and/or Qp_(blk_Q) may be derived from acombination of one or and/or more of: QP values of multiplecorresponding luma blocks; the number of samples of the luma blockcorresponding to the chroma block; the luma QP value corresponding to apredetermined chroma position. In some examples, Qp_(blk_P) and/orQp_(blk_Q) may be derived using a function such as, for example, aninteger averaging with rounding function, a maximum value function. Itshould be noted, that it possible to have a partial luma blockcorresponding to a chroma block. FIGS. 14A-14B illustrate examples ofpossible luma partitionings corresponding to chroma blocks P and Q,where each of the luma blocks have a QP values QP_X. In the example,illustrated in FIG. 14A the chroma block P is collocated with the lumablocks having QP values QP_1 and QP_3 and the chroma block Q iscollocated with the luma blocks having QP values QP_2 and QP_4. In theexample, illustrated in FIG. 14B the chroma block P is collocated withthe luma blocks having QP values QP_1, QP_3, and QP_5 and the chromablock Q is collocated with the luma blocks having QP values QP_2 andQP_4. In one example, for the example illustrated in FIG. 14A,Qp_(blk_P) and Qp_(blk_Q) may be derived as follows:

Qp _(blk_P)=(QP_1+QP_3+1)>>1

Qp _(blk_Q)=(QP_2+QP_4+1)>>1

In one example, for the example illustrated in FIG. 14B, Qp_(blk_P) andQp_(blk_Q) may be derived as follows:

QP _(blk_P)=(QP_1+QP_5+2*QP_3+2)>>1

QP _(blk_Q)=(QP_2+QP_4+1)>>1

In one example, Qp_(blk_P) and/or Qp_(blk_Q) may be derived byidentifying a set of chroma positions and for each chroma positionidentifying a corresponding luma positions. For each, corresponding lumaposition, a corresponding QP value may be determined. The correspondingQP values may be used to derive Qp_(blk_P) and/or Qp_(blk_Q).

As described above, in one example, a wider strong filter condition mayinclude whether both a first condition and a second condition are true,where a first condition may be true when d<β, where d is determined asfollows:

dp0=xCalcDP(R _(C)[0]);

dq0=xCalcDQ(R _(C)[0]));

dp1=xCalcDP(R _(C)[1]);

dq1=xCalcDQ(R _(C)[1]);

d0=dp0+dq0;

d1=dp1+dq1;

d=d0+d1.

-   -   Where,    -   R_(C)[N] corresponds to chroma lines perpendicular to the edge        being deblocked and at distance N from the top of current chroma        segment being deblocked; and

In one example, a filter condition may include a condition is that istrue when d<β, where d is determined as follows:

dp0=xCalcDP(R _(C)[0]);

dq0=xCalcDQ(12_(C)[0]));

d0=dp0+dq0;

d=d0+d1.

In some examples, the condition may be checked for x sample segments ofthe chroma deblocking boundary (e.g., x=2). This reduces the number oflines which a gradient needs to be computed in the worst-case. It shouldbe noted that in the worst case the first condition would computegradients (xCalcDQP for every line) whereas the above condition wouldcompute gradients once every 2 lines.

As described above, ITU-T H.265, variables β and t_(C) are used forfiltering decisions and clipping operations. For example, β and/or t_(C)are used to determine whether a strong filter is used and/or to clipfiltered sample values. It should be noted that in JVET-K1001 the peaksignal to noise ratio (PSNR) is higher than a given level ofquantization compared to ITU-T H.265. Thus, in some cases, it may beuseful to modify β and/or t_(C) in order to modify deblocking strength.That is, if the level of distortion is at a given level of quantizationis lower, the amount of perceived blockiness is lower and thus, lessdeblocking is needed. In one example, β may be modified by as follows:β=β<<n. In one example, β may be modified by as follows: β=β>>n. In oneexample, t_(C) may be modified by as follows: t_(C)=t_(C)<<n. In oneexample, t_(C) may be modified by as follows: t_(C)=t_(C)>>n. In oneexample, n may be determined based on a combination of one or more of:Slice type, QP value, block size, bit depth, intra prediction mode,motion vectors (e.g., magnitude), channel type, and/or component type.For example, in one example, t_(C)=t_(C)>>2 may be used for intra slicesand t_(C)=t_(C)>>4 may be used for inter slices. In one example,t_(C)=t_(C)>>2 may be used for the luma component and t_(C)=t_(C)>>4 maybe used for chroma components.

“CE2-2.1.1: Long deblocking filters and fixes,” 11th Meeting of ISO/IECJTC1/SC29/WG11 10-18 Jul. 2018, Ljubljana, S I, document JVET-K0307-v1which is referred to herein as JVET-K0307, describes longs filters anddecisions for the luma component. Based on the filtering techniquesdescribed above, the filtering techniques in JVET-K0307 may be modifiedto enable use of long asymmetric filters. For long asymmetric filters,the number of samples deblocked on the larger block side is greater thanthat on the smaller block side. The deblocking decision processes toselect from this extended filter set are described in detail below. Theextended filter set may be used for strong deblocking throughout thedeblocking.

In one example, according to the techniques herein, luma strongerfilters are used when either side has a large block and a modifiedstrong filter condition is met. In one example, a luma large blockcorresponds to a width>=32 for a vertical edge, and a height>=32 for ahorizontal edge.

In one example, a luma stronger filter may be defined as follows:

-   -   Block boundary samples p_(i) and q_(i) for i=0 to S−1 are then        replaced by linear interpolation as follows:

p _(i)′=(f _(i)*Middle_(s,t)+(64−f _(i))*P _(s)+32)>>6), clipped to p_(i) ±tc

q _(i)′=(g _(i)*Middle_(s,t)+(64−g _(i))*Q _(t)+32)>>6), clipped to q_(i) ±tc

-   -   where f_(i), Middle_(s,t), P_(a) and Q_(s) are given below in        Table 10:

TABLE 10 7, 7 f_(i) = 59 − i * 9, can also be described as f = {59, 50,41, 32, 23, 14, 5} (p side: 7, g_(i) = 59 − i * 9, can also be describedas g = {59, 50, 41, 32, 23, 14, 5} q side: 7) Middle_(7, 7) = (2 * (p₀ +q₀) + p₁ + q₁ + p₂ + q₂ + p₃ + q₃ + p₄ + q₄ + p₅ + q₅ + p₆ + q₆ + 8) >>4 P₇ = (p₆ + p₇ + 1) >> 1, Q₇ = (q₆ + q₇ + 1) >> 1 7,3 f_(i) = 59 − i *9, can also be described as f = {59, 50, 41, 32, 23, 14, 5} (p side: 7g_(i) = 53 − i * 21, can also be described as g = {53, 32, 11} q side:3) Middle_(7, 3) = (2 * (p₀ + q₀) + q₀ + 2 * (q₁ + q₂) + p₁ + q₁ + p₂ +p₃ + p₄ + p₅ + p₆ + 8) >> 4 P₇ = (p₆ + p₇ + 1) >> 1, Q₃ = (q₂ +q₃ + 1) >> 1 3,7 g_(i) = 59 − i * 9, can also be described as g = {59,50, 41, 32, 23, 14, 5} (p side: 3 f_(i) = 53 − i * 21, can also bedescribed as f = {53, 32, 11} q side: 7) Middle_(3, 7) = (2 * (q₀ +p₀) + p₀ + 2 * (p₁ + p₂) + q₁ + p₁ + q₂ + q₃ + q₄ + q₅ + q₆ + 8) >> 4 Q₇= (q₆ + q₇ + 1) >> 1, P₃ = (p₂ + p₃ + 1) >> 1

-   -   It should be noted using 7,7 filters on a step function results        in a nearly uniformly increasing ramp. However, using a 7,3        filter with        Middle_(7,3)=(2*(p₀+q₀)+q₀+2*(q₁+q₂)+p₁+q₁+p₂+p₃+p₄+p₅+p₆+8)>>4        on a step function may not result in a nearly uniformly        increasing ramp. In one example, according to the techniques        herein,        Middle_(7,3)=(2*(p₀+q₀)+2*q₀+3*(q₁+q₂)+p₁+q₁+p₂+p₃+p₄+p_(s)+p₆+8)>>4        and        Middle_(3,7)=(2*(q₀+p₀)+2*p₀+3*(p₁+p₂)+q₁+p₁+q₂+q₃+q₄+q₅+q₆+8)>>4        may be used.

In one example, the control process is further based on gradientscomputed for two lines of four sample segments; comparison of absolutepixel value difference with tc; and comparison of other absolute pixelvalue differences with β. More gradients are computed for large blockside. The control process may be as follows:

-   -   1. The variables dpq0, dpq3, dp, dq, and d are derived as        follows:        -   dp0, dp3, dq0, dq3 are first derived as in ITU-T H.265        -   dpq0, dpq3, dp, dq, d are then derived as in ITU-T H.265        -   As in ITU-T H.265, When d is less than β, the following            ordered steps apply:            -   a. dpq is derived as in ITU-T H.265.            -   b. sp₃=Abs(p₃−p₀), derived as in ITU-T H.265                -   if (p side is greater than or equal to 32)

sp ₃=(sp ₃+Abs(p ₇ −p ₃)+1)>>1

-   -   -   -   c. sq₃=Abs(q₀−q₃), derived as in ITU-T H.265                -   if (q side is greater than or equal to 32)

sq ₃=(sq ₃+Abs(q ₇ −q ₃)+1)>>1

-   -   -   -   d. As in ITU-T H.265 derive, StrongFilterCondition=(dpq                is less than (β>>2), sp₃+sq₃ is less than ((p or q side                is greater than or equal to 32)?(3*β>>5):(β>>3)), and                Abs(p₀−q₀) is less than (5*t_(C)+1)>>1)?TRUE:FALSE            -   e. if (p side or q side is greater than or equal to 32)

Set dSp1,dSp2 to Abs(p ₃ −p ₀)

Set dSq1,dSq2 to Abs(q ₃ −q ₀)

-   -   -   -   -   if (q side is greater than or equal to 32)

dSq1=abs(q ₄−2*q ₂ +q ₀)

dSq2=abs(q ₆−2*q ₃ +q ₀)

-   -   -   -   -   if (p side is greater than or equal to 32)

dSp1=abs(p ₄−2*p ₂ +p ₀)

dSp2=abs(p ₆−2*p ₃ +p ₀)

-   -   -   -   -   Compute d_strong1 and d_strong2 as:

d_strong1=dSp1+dSq1

d_strong2=dSp2+dSq2

Compute StrongFilterCondition=(StrongFilterCondition &&((d_strong1<((3*beta)>>5))&&(d_strong2<((3*beta)>>5))))?TRUE:FALSE

-   -   -   -   f. When StrongFilterCondition is TRUE, use luma stronger                filter (may be selected based on block-sizes at edge                boundary).

In one example, a control process may be as follows:

-   -   The variables dpq0, dpq3, dp, dq, and d are derived as follows:        -   dp0, dp3, dq0, dq3 are first derived as in ITU-T H.265        -   dpq0, dpq3, dp, dq, d are then derived as in ITU-T H.265        -   As in ITU-T H.265, When d is less than (3, the following            ordered steps apply:            -   dpq is derived as in ITU-T H.265.            -   sp₃=Abs(p₃−p₀), derived as in ITU-T H.265                -   if (p side is greater than or equal to 32 && q side                    is greater than or equal to 16)

sp ₃=(sp ₃+Abs(p ₇ −p ₃)+1)>>1

-   -   -   -   sq₃=Abs(q₀−q₃), derived as in ITU-T H.265                -   if (q side is greater than or equal to 32 && p side                    is greater than or equal to 16)

sq ₃=(sq ₃+Abs(q ₇ −q ₃)+>>1

-   -   As in ITU-TH.265 derive, StrongFilterCondition=(dpq is less than        (β>>2), sp₃+sq₃ is less than (((p side is greater than or equal        to 32 && q side is greater than or equal to 16)) OR (q side is        greater than or equal to 32 && p side is greater than or equal        to 16))?(3*β>>5):(β>>3)), and Abs(p₀−q₀) is less than        (5*t_(C)+1)>>1)?TRUE:FALSE

It should be noted that with respect to the control processes describedherein, in some examples, the term (3*β>>5) may be replaced with theterm (2*β>>5).

It should be noted that the conditions (p side is greater than or equalto 32 && q side is greater than or equal to 16) and (q side is greaterthan or equal to 32 && p side is greater than or equal to 16) determineif a luma stronger filter may be applied. It should be noted that inother examples, additional conditions may be applied (e.g., one or morepreceding conditions) may be used to determine if a luma stronger filtermay be applied. In one example, additional conditions may be as follows:

if (p side is greater than or equal to 32 && q side is greater than orequal to 16)∥(q side is greater than or equal to 32 && p side is greaterthan or equal to 16); however for (7,7,7,3,3,7) the decision process is(p side is greater than or equal to 32∥q side is greater than or equalto 32). The idea is the lower threshold selection of 3*β>>5 instead ofβ>>3 applies for any of these luma stronger filter preceding decisionprocess.

In one example, according to the techniques describe herein luma may bedeblocked according to a 4×4 luma sample grid (or in some examplesaccording to a 8×8 luma sample grid). In this example, luma strongerfilters, described above as WS00P P-side filter and WS00Q Q-side filtermay be used for large blocks where large block corresponds to width>=32for a vertical edge, and height>=32 for a horizontal edge and theadjacent block is greater than or equal to 16. The control process maybe further based on gradients computed for two lines of 4 samplesegments; comparison of absolute pixel value difference with tc; andcomparison of other absolute pixel value differences with β, asdescribed in further detail below. Further, when p₀ belongs to CTU abovecurrent CTU, the following limited support luma filter provided in Table8B above may be used.

In some cases, a subset of samples are not accessible. In such cases, acontrol process using this subset of samples may be affected. This maylead to asymmetry in the computation of a gradient. In some examples, inthis cases, another control process may be used.

In one example, the control process may be as follows:

-   -   The variables dpq0, dpq3, dp, dq, and d are derived as follows:        -   dp0, dp3, dq0, dq3 are first derived as in ITU-T H.265

LongTapDeblocking=((p side>=32 && q side>=16)∥(p side>=16 && qside>=32)))?TRUE:FALSE

ControlSamplesAccessible=p ₀ belongs to CTU above current CTU?FALSE:TRUE

-   -   -   if (LongTapDeblocking)            -   if (p side is greater than or equal to 32 &&                ControlSamplesAccessible)

dp0=(dp0+Abs(p _(5,0)−2*p _(4,0) +p _(3,0))+1)>>1

dp3=(dp3+Abs(p _(5,3)−2*p _(4,3) +p _(3,3))+1)>>1

-   -   -   -   if (q side is greater than or equal to 32)

dq0=(dq0+Abs(p _(5,0)−2*q _(4,0) +q _(3,0))+1)>>1

dq3=(dq3+Abs(p _(5,3)−2*q _(4,3) +p _(3,3))+1)>>1

-   -   -   -   dpq0, dpq3, dp, dq, d are then derived as in ITU-T H.265

    -   As in ITU-T H.265, When d is less than 13, the following ordered        steps apply:        -   dpq is derived as in ITU-T H.265.        -   sp₃=Abs(p₃−p₀), derived as in ITU-T H.265            -   if (p side is greater than or equal to 32 &&                LongTapDeblocking && ControlSamplesAccessible)

sp ₃=(sp ₃+Abs(p ₇ −p ₃)+1)>>1

-   -   -   sq₃=Abs(q₀−q₃), derived as in ITU-T H.265            -   if (q side is greater than or equal to 32 &&                LongTapDeblocking)

sq ₃=(sq ₃+Abs(q ₇ −q ₃)+1)>>1

-   -   -   As in ITU-T H.265 derive, StrongFilterCondition=(dpq is less            than (β>>2), sp₃+sq₃ is less than            (LongTapDeblocking)?(3*β>>5):(β>>3)), and Abs(p₀−q₀) is less            than (5*t_(C)+1)>>1)?TRUE:FALSE        -   When StrongFilterCondition is TRUE and LongTapDeblocking is            TRUE, use luma stronger filter on the side with length            perpendicular to boundary edge greater than or equal to 32,        -   Otherwise, When StrongFilterCondition is TRUE and            LongTapDeblocking is FALSE, use another strong filter (e.g.            HEVC strong filter HEVC_P, HEVC_Q).

In one example, thresholds used in comparisons may also be based onposition. For example, whether the edge being deblocked is aligned withthe CTU boundary.

In one example, one of the following may be needed for a 4×4 lumadeblocking grid:

-   -   When block width/height is equal to 4 for vertical        edge/horizontal edge respectively and if the HEVC filter on/off        condition (i.e. d<Beta, where d=d₀+d₃ and d₀=d_(p0)+d_(q0) and        d₃=d_(p3)+d_(q3)) is evaluated to true for the respective edge,        then this method would enforce HEVC normal/weak filter with        maximum one sample modification. Therefore the following HEVC        condition is checked|δ|<10(t_(C)) where        δ=(9*(q₀−p₀)−(3*(q₁−p₁)+8>>4, and if the condition is evaluated        to true, then samples p₀ and q₀ are modified, otherwise no        filtering is applied.    -   When block width/height is equal to 4 for vertical        edge/horizontal edge respectively, then a maximum of three        samples are used in filter decision and only one sample is        modified by the filter. i.e. p₂ ^(i) is used to replace p₃ ^(i)        in strong/weak filter condition checks and both strong and weak        filter are only allowed to modify p₀ and q₀

In one example, according to the techniques describe herein chroma maybe deblocked according to a 2×2 chroma sample grid (or in some examplesaccording to a 4×4 luma sample grid). In this example, HEVC_P P-side andHEVC_Q Q-side filters described above, may be used. Further, when p₀belongs to CTU above current CTU, the chroma weak filter described aboveas NW00P above may be used. In one example, the strong filter may beused when the HEVC luma strong filter condition computed for chroma isTRUE and any of the following conditions is true:

-   -   The edge type is vertical an p₀ belongs to CU with width>=16        (chroma samples) and q₀ belongs to CU with width>=16 (chroma        samples)    -   The edge type is horizontal and p₀ belongs to CU with height>=16        (chroma samples) and q₀ belongs to CU with height>=16 (chroma        samples)

As described above, in ITU-T H.265, a boundary strength (Bs) isdetermined as one of 0, 1, or 2 for each boundary. As further describedabove, a draft text of a video coding specification is described inJVET-J1001 and JVET-K1001. “Versatile Video Coding (Draft 3),” 12thMeeting of ISO/IEC JTC1/SC29/WG11 3-12 Oct. 2018, Macao, C N, documentJVET-L1001-v1, which is incorporated by reference herein, and referredto as JVET-L1001, is an update to JVET-K1001. JVET-L1001 provides thefollowing with respect to determining a boundary strength value, bS[ ][], value:

-   -   The variables xD_(i), yD_(j), xN and yN are derived as follows:        -   If edgeType is equal to EDGE_VER, xD_(i) is set equal to            (i<<3), yD_(j) is set equal to (j<<2), xN is set equal to            Max(0, (nCbW/8)−1) and yN is set equal to (nCbH/4)−1.        -   Otherwise (edgeType is equal to EDGE_HOR), xD_(i) is set            equal to (i<<2), yD_(j) is set equal to (j<<3), xN is set            equal to (nCbW/4)−1 and yN is set equal to Max(0,            (nCbH/8)−1).            -   For xD_(i) with i=0 . . . xN and yD_(j) with j=0 . . .                yN, the following applies:                -   If edgeFlags[xD_(i)][yD_(j)] is equal to 0, the                    variable bS[xD_(i)][yD_(j)] is set equal to 0.                -   Otherwise, the following applies:                -    The sample values p₀ and q₀ are derived as follows:                -    If edgeType is equal to EDGE_VER, p₀ is set equal                    to recPicture [xCb+xD_(i)−1][yCb+yD_(j)] and q₀ is                    set equal to recPicture [xCb+xD_(i)][yCb+yD_(j)].                -    Otherwise (edgeType is equal to EDGE_HOR), p₀ is                    set equal to recPicture [xCb+xD_(i)][yCb+yD_(j)−1]                    and q₀ is set equal to recPicture                    [xCb+xD_(i)][yCb+yD_(j)].                -    The variable bS[xD_(i)][yD_(j)] is derived as                    follows:                -    If the sample p₀ or q₀ is in the coding block of a                    coding unit coded with intra prediction mode,                    bS[xD_(i)][yD_(j)] is set equal to 2.                -    Otherwise, if the block edge is also a transform                    block edge and the sample p₀ or q₀ is in a transform                    block which contains one or more non-zero transform                    coefficient levels, bS[xD_(i)][xD_(j)] is set equal                    to 1.                -    Otherwise, if one or more of the following                    conditions are true, bS [xD_(i)][yD_(j)] is set                    equal to 1:                -    For the prediction of the coding subblock                    containing the sample p₀ different reference                    pictures or a different number of motion vectors are                    used than for the prediction of the coding subblock                    containing the sample q₀.                -    One motion vector is used to predict the coding                    subblock containing the sample p₀ and one motion                    vector is used to predict the coding subblock                    containing the sample q₀, and the absolute                    difference between the horizontal or vertical                    component of the motion vectors used is greater than                    or equal to 4 in units of quarter luma samples.                -    Two motion vectors and two different reference                    pictures are used to predict the coding subblock                    containing the sample p₀, two motion vectors for the                    same two reference pictures are used to predict the                    coding subblock containing the sample q₀ and the                    absolute difference between the horizontal or                    vertical component of the two motion vectors used in                    the prediction of the two coding subblocks for the                    same reference picture is greater than or equal to 4                    in units of quarter luma samples.                -    Two motion vectors for the same reference picture                    are used to predict the coding subblock containing                    the sample p₀, two motion vectors for the same                    reference picture are used to predict the coding                    subblock containing the sample q₀ and both of the                    following conditions are true:                -    The absolute difference between the horizontal or                    vertical component of list 0 motion vectors used in                    the prediction of the two coding subblocks is                    greater than or equal to 4 in quarter luma samples,                    or the absolute difference between the horizontal or                    vertical component of the list 1 motion vectors used                    in the prediction of the two coding subblocks is                    greater than or equal to 4 in units of quarter luma                    samples.                -    The absolute difference between the horizontal or                    vertical component of list 0 motion vector used in                    the prediction of the coding subblock containing the                    sample p₀ and the list 1 motion vector used in the                    prediction of the coding subblock containing the                    sample q₀ is greater than or equal to 4 in units of                    quarter luma samples, or the absolute difference                    between the horizontal or vertical component of the                    list 1 motion vector used in the prediction of the                    coding subblock containing the sample p₀ and list 0                    motion vector used in the prediction of the coding                    subblock containing the sample q₀ is greater than or                    equal to 4 in units of quarter luma samples.                -    Otherwise, the variable bS[xD_(i)][yD_(j)] is set                    equal to 0.

With respect to determining boundaries, in one example, a derivationprocess of a transform block boundary may be as follows:

-   -   Inputs to this process are:        -   a location (xB0, yB0) specifying the top-left sample of the            current block relative to the top-left sample of the current            coding block,        -   a variable nTbW specifying the width of the current block,        -   a variable nTbH specifying the height of the current block,        -   a variable treeType specifying whether a single tree            (SINGLE_TREE) or a dual tree is used to partition the CTUs            and, when a dual tree is used, whether the luma            (DUAL_TREE_LUMA) or chroma components (DUAL_TREE_CHROMA) are            currently processed,        -   a variable filterEdgeFlag,        -   a two-dimensional (nCbW)×(nCbH) array edgeFlags,            maxFilterLengthQ and maxFilterLengthP        -   a variable edgeType specifying whether a vertical (EDGE_VER)            or a horizontal (EDGE_HOR) edge is filtered.    -   Output of this process is the modified two-dimensional        (nCbW)×(nCbH) array edgeFlags, maxLengthQ and maxLengthP.    -   The maximum transform block size maxTbSize is derived as        follows:

maxTbSize=(treeType==DUAL_TREE_CHROMA)?MaxTbSizeY/2:MaxTbSize Y

-   -   Depending on maxTbSize, the following applies:        -   If nTbW is greater than maxTbSize or nTbH is greater than            maxTbSize, the following ordered steps apply.    -   1. The variables newTbW and newTbH are derived as follows:

newTbW=(nTbW>maxTbSize)?(nTbW/2):nTbW

newTbH=(nTbH>maxTbSize)?(nTbH/2):nTbH

-   -   2. The derivation process of transform block boundary as        specified in this clause is invoked with the location (xB0,        yB0), the variables nTbW set equal to newTbW and nTbH set equal        to newTbH, the variable filterEdgeFlag, the array edgeFlags,        maxFilterLengthQ, maxFilterLengthP, and the variable edgeType as        inputs, and the output is the modified version of array        edgeFlags, maxFilterLengthQ and maxFilterLengthP.    -   3. If nTbW is greater than maxTbSize, the derivation process of        transform block boundary as specified in this clause is invoked        with the luma location (xTb0, yTb0) set equal to (xTb0+newTbW,        yTb0), the variables nTbW set equal to newTbW and nTbH set equal        to newTbH, the variable filterEdgeFlag, the array edgeFlags,        maxFilterLengthQ, maxFilterLengthP and the variable edgeType as        inputs, and the output is the modified version of array        edgeFlags, maxFilterLengthQ and maxFilterLengthP.    -   4. If nTbH is greater than maxTbSize, the derivation process of        transform block boundary as specified in this clause is invoked        with the luma location (xTb0, yTb0) set equal to (xTb0,        yTb0+newTbH), the variables nTbW set equal to newTbW and nTbH        set equal to newTbH, the variable filterEdgeFlag, the array        edgeFlags, maxFilterLengthQ, maxFilterLengthP and the variable        edgeType as inputs, and the output is the modified version of        array edgeFlags, maxFilterLengthQ and maxFilterLengthP.    -   5. If nTbW is greater than maxTbSize and nTbH is greater than        maxTbSize, the derivation process of transform block boundary as        specified in this clause is invoked with the luma location        (xTb0, yTb0) set equal to (xTb0+newTbW, yTb0+newTbH), the        variables nTbW set equal to newTbW and nTbH set equal to newTbH,        the variable filterEdgeFlag, the array edgeFlags,        maxFilterLengthQ, maxFilterLengthP and the variable edgeType as        inputs, and the output is the modified version of array        edgeFlags, maxFilterLengthQ and maxFilterLengthP.        -   Otherwise, the following applies:        -   If edgeType is equal to EDGE_VER, the value of            edgeFlags[xB0][yB0+k] for k=0 . . . nTbH−1 is derived as            follows:        -   If xB0 is equal to 0, edgeFlags[xB0][yB0+k] is set equal to            filterEdgeFlag.        -   Otherwise, edgeFlags[xB0][yB0+k] is set equal to 1.        -   If edgeFlags[xB0][yB0+k] is equal to 1            -   If nTbW {or “width in luma samples of transform block at                luma position (xB0, yB0+k)”} is equal to or greater than                32, maxFilterLengthQ[xB0][yB0+k]=7            -   Otherwise, maxFilterLengthQ[xB0][yB0+k]=3            -   If nTbW [xB0−1][yB0+k] {or “width in luma samples of                transform block at luma position (xB0−1, yB0+k)”} is                equal to or greater than 32,                maxFilterLengthP[xB0][yB0+k]=7            -   Otherwise, maxFilterLengthP[xB0][yB0+k]=3            -   If edgeType is EDGE_HOR and (yB0% CtbSizeY) is equal to                0, maxFilterLengthCbCr[xB0+k][yB0]=1            -   Otherwise, If width in chroma samples of transform block                at chroma position (xB0/SubWidthC, yB0/SubHeightC+k) is                equal to or greater than 8 and width in chroma samples                of transform block at luma position (xB0−1, yB0+k) is                equal to or greater than 8,                maxFilterLengthCbCr[xB0/SubWidthtC][yB0/SubHeightC+k]=3            -   Otherwise, maxFilterLengthCbCr[xB0][yB0+k]=1    -   Otherwise        -   If edgeType is EDGE_HOR and (yB0% CtbSizeY) is equal to 0,            maxFilterLengthCbCr[xB0+k][yB0]=1        -   Otherwise, If width in chroma samples of transform block at            chroma position (xB0, yB0+k) and chroma position (xB0−1,            yB0+k) is equal to or greater than 8,            maxFilterLengthCbCr[xB0][yB0+k]=3        -   Otherwise, maxFilterLengthCbCr[xB0][yB0+k]=1        -   Otherwise (edgeType is equal to EDGE_HOR), the value of            edgeFlags[xB0+k][yB0] for k=0 . . . nTbW−1 is derived as            follows:        -   If yB0 is equal to 0, edgeFlags[xB0+k][yB0] is set equal to            filterEdgeFlag.        -   Otherwise, edgeFlags[xB0+k][yB0] is set equal to 1.        -   If edgeFlags[xB0+k][yB0] is equal to 1, the value of            maxFilterLengthQ[xB0+k][yB0][0], maxFilterLengthP[xB0+k]            [yB0][0] for k=0 . . . nTbW−1 is derived as follows:            -   If nTbH {or “height in luma samples of transform block                at luma position (xB0, yB0+k)”} is equal to or greater                than 32, maxFilterLengthQ[xB0+k][yB0]=7            -   Otherwise, maxFilterLengthQ[xB0+k][yB0]=3            -   If nTbH[xB0+k][yB0−1] {or “height in luma samples of                transform block at luma position (xB0+k, yB0−1)”} is                equal to or greater than 32,                maxFilterLengthP[xB0+k][yB0]=7            -   Otherwise, maxFilterLengthP[xB0+k][yB0]=3            -   If edgeType is EDGE_HOR and (yB0% CtbSizeY) is equal to                0, maxFilterLengthCbCr[xB0+k][yB0]=1            -   Otherwise, If height in chroma samples of transform                block at luma position (xB0/SubWidthC+k, yB0/SubHeightC)                is equal to or greater            -   than 8 and height in chroma samples of transform block                at luma position (xB0/SubWidthtC+k, yB0/SubHeightC—1) is                equal to or greater than 8,                maxFilterLengthCbCr[xB0/SubWidthC+k][yB0/SubHeightC]=3            -   Otherwise, maxFilterLengthCbCr[xB0+k][yB0]=1                -   Otherwise            -   If edgeType is EDGE_HOR and (yB0% CtbSizeY) is equal to                0, maxFilterLengthCbCr[xB0+k][yB0]=1            -   Otherwise, If height in chroma samples of transform                block at chroma position (xB0+k, yB0) and at chroma                position (XB0+k, yB0−1) is equal to or greater than 8,                maxFilterLengthCbCr[xB0+k][yB0]=3            -   Otherwise, maxFilterLengthCbCr[xB0+k][yB0]=1

With respect to determining boundaries, in one example, a derivationprocess of a coding subblock boundary may be as follows:

-   -   Inputs to this process are:        -   a location (xCb, yCb) specifying the top-left sample of the            current coding block relative to the top-left sample of the            current picture,        -   a variable nCbW specifying the width of the current coding            block,        -   a variable nCbH specifying the height of the current coding            block,        -   a two-dimensional (nCbW)×(nCbH) array edgeFlags,            maxFilterLengthQ and maxFilterLengthP,        -   a variable edgeType specifying whether a vertical (EDGE_VER)            or a horizontal (EDGE_HOR) edge is filtered.    -   Output of this process is the modified two-dimensional        (nCbW)×(nCbH) array edgeFlags, maxFilterLengthQ and        maxFilterLengthP.    -   The number of coding subblock in horizontal direction numSbX and        in vertical direction numSbY are derived as follows:        -   If CuPredMode[xCb][yCb]==MODE_INTRA, numSbX and numSbY are            both set equal to 1.        -   Otherwise, numSbX and numSbY are set equal to            NumSbX[xCb][yCb] and NumSbY[xCb][yCb], respectively.    -   A variable implicitTU is derived as follows:        -   If nCbW is greater than maxTbSize and nCbH is greater than            maxTbSize and cu_cbf is equal to 1 and maxTbSize is equal to            or larger than 32, implicitTU is set equal to 1 otherwise it            is set equal to 0.    -   When component is luma, depending on the value of edgeType the        following applies:        -   If edgeType is equal to EDGE_VER and numSbX is greater than            1,        -   the following applies for i=1 . . . min((nCbW/8)−1,            numSbX−1), k=0 . . . nCbH−1:

edgeFlags[i*Max(8,nCbW/numSbX)][k]=1(8 861)

-   -   -   the following applies for i=0 . . . min((nCbW/8)−1,            numSbX−1), k=0 . . . nCbH−1

If edgeFlags[i*Max(8,nCbW/numSbX)][k] is equal to 1,

-   -   -   If i is equal to 0,        -   If nCbW at location (xCb−1,yCb) is greater than or equal to            32,        -   If numSbX at location (xCb−1,yCb) is greater than 1,

maxFilterLengthP[i*Max(8,nCbW/numSbX)][k]=5

Otherwise

maxFilterLengthP[i*Max(8,nCbW/numSbX)][k]=7

Otherwise

maxFilterLengthP[i*Max(8,nCbW/numSbX)][k]=3

maxFilterLengthQ[i*Max(8,nCbW/numSbX)][k]=min(5,maxFilterLengthQ[i*Max(8,nCbW/numSbX)][k])

-   -   -   Otherwise if i is equal to maxTbSize/8 and implicitTU is            equal to 1

maxFilterLengthP[i*Max(8,nCbW/numSbX)][k]=5

maxFilterLengthQ[i*Max(8,nCbW/numSbX)][k]=5

-   -   -   Otherwise if i is equal to 1 or nCbW/8−1 or (implicitTU is            equal to 1 and (i is equal to (maxTbSize−8)/8 or            (maxTbSize+8)/8))

maxFilterLengthP[i*Max(8,nCbW/numSbX)][k]=2

maxFilterLengthQ[i*Max(8,nCbW/numSbX)][k]=2

Otherwise

maxFilterLengthP[i*Max(8,nCbW/numSbX)][k]

maxFilterLengthQ[i*Max(8,nCbW/numSbX)][k]=3

-   -   -   Otherwise if edgeType is equal to EDGE_HOR and numSbY is            greater than 1,        -   The following applies for j=1 . . . min((nCbH/8)−1,            numSbY−1), k=0 . . . nCbW−1:

edgeFlags[k][j*Max(8,nCbH/numSbY)]=1

-   -   -   The following applies for j=0 . . . min((nCbH/8)−1,            numSbY−1), k=0 . . . nCbW−1:

    -   If edgeFlags[k][j*Max(8, nCbH/numSbY)] is equal to 1        -   If j is equal to 0,        -   If nCbH at location (xCb,yCb−1) is greater than or equal to            32,            -   If numSbY at location (xCb,yCb−1) is greater than 1,

maxFilterLengthP[k][j*Max(8,nCbH/numSbY)]

Otherwise

maxFilterLengthP[k][j*Max(8,nCbH/numSbY)]=7

Otherwise

maxFilterLengthP[k][j*Max(8,nCbH/numSbY)]=3

maxFilterLengthQ[k][j*Max(8,nCbH/numSbY)]=min(5,maxFilterLengthQ[k][j*Max(8,nCbH/numSbY)])

-   -   -   -   Otherwise if j is equal to maxTbSize/8 and implicitTU is                equal to 1

maxFilterLengthP[k][j*Max(8,nCbH/numSbY)]=5

maxFilterLengthQ[k][j*Max(8,nCbH/numSbY)]=5

-   -   -   -   Otherwise if j is equal to 1 or nCbH/8−1 or (implicitTU                is equal to 1 and ((maxTbSize−8)/8 or (maxTbSize+8)/8))

maxFilterLengthP[k][j*Max(8,nCbH/numSbY)]=2

maxFilterLengthQ[k][j*Max(8,nCbH/numSbY)]=2

Otherwise

maxFilterLengthP[k][j*Max(8,nCbH/numSbY)]=3

maxFilterLengthQ[k][j*Max(8,nCbH/numSbY)]=3.

As provided above, transform coefficients in the chroma block are notconsidered in the derivation of boundary strength in JVET-L1001.Further, in JVET-L1001 chroma deblocking is performed only when theboundary strength is larger than 1 and in ITU-T H.265 chroma deblockingis performed only when the boundary strength is equal to 2 which meanschroma deblocking is only performed when a P-side or Q-side block is anintra block. “CE11: Long-tap deblocking filter for luma and chroma(CE11.1.6),” 12th Meeting of ISO/IEC JTC1/SC29/WG11 3-12 Oct. 2018,Macao, C N, document JVET-L0327-v1, which is referred to herein asJVET-L0327, describes where chroma deblocking is performed when theboundary strength is 2, or when the boundary strength is 1 for a largeblock boundary, where a large block boundary occurs when the block sizeat both the P-side and Q-side are larger than a threshold. It should benoted that in JVET-L0327 the derivation of boundary strength as providedin ITU-T H.265 is used with an additional condition that when thecurrent block has non-zero coefficients on the current component, theboundary strength for that block when deblocking the current componentwill be larger than 0. “CE11: Long deblocking filters for luma(CE11.1.1) and for both luma and chroma (CE11.1.9),” 12th Meeting ofISO/IEC JTC1/SC29/WG11 3-12 Oct. 2018, Macao, C N, document JVET-L0072,which is referred to herein as JVET-L0072, describes where chromadeblocking is performed when the boundary strength is 2, or when theboundary strength is 1 for an inter block. It should be noted that inJVET-L0072 the derivation of boundary strength as provided in ITU-TH.265 is used with an additional condition that when the current blockhas non-zero coefficients on the current component, the boundarystrength for that block when deblocking the current component will be 1.

According to the techniques herein, in one example, the chromadeblocking may only be performed when the boundary strength is 2 or theboundary is strength is 1 and the chroma block at P-side or Q-side hasnon-zero coefficients. The derivation of boundary strength may be asprovided in ITU-T H.265 with zero or more additional conditions or asprovided in JVET-L1001. In particular, deblocking on a Cb (or Cr) blockcan be performed only when the boundary strength is larger than 1 or thecbf flag of that Cb(or Cr) block is non-zero or the cbf flag of theneighboring block at P-side of that Cb (or Cr) block is non-zero (i.e.,the block has at least one non-zero coefficient).

In one example, according to the techniques herein, boundary strengthfor chroma, ucBs may be derived as follows:

-   -   ucBS=0;    -   cbf=0;

if (TU::getCbf(tuQ,COMPONENT_Y)∥TU::getCbf(tuP,COMPONENT_Y))cbf|=(1<<0);

if(TU::getCbf(tuQ,COMPONENT_Cb)∥TU::getCbf(tuP,COMPONENT_Cb))cbf|=(1<<1);

if(TU::getCbf(tuQ,COMPONENT_Cr)∥TU::getCbf(tuP,COMPONENT_Cr))cbf|=(1<<2);

-   -   if (cbf)

ucBs=cbf+3;//distinguish with the case ucBS=2

-   -   where,    -   getCbf gets the cbf flag of a component (specified by the second        input parameter) in a TU (corresponding to first parameter). The        cbf flag equal to 0 means there is no non-zero coefficients in        the TU for the component;    -   A|=B represents A=A|B, where = is an assign operation and | is a        bitwise OR operation; tuP and tuQ represent the TU for P and Q        side respectively for the segment of samples under        consideration;    -   COMPONENT_Y, COMPONENT_Cb, COMPONENT_Cr represent identifiers        for Y, Cb and Cr component respectively.

Further, in this case, chroma deblocking may be performed as follows:

If (ucBs==2∥(ucBs>2&&(((ucBs−3)>>(chromaIdx+1))&0x1))//chromaIdx=0

-   -   when component is Cb and chromaIdx=1 when component is Cr,        -   Deblocking can be performed        -   Otherwise,        -   Deblocking cannot be performed        -   Where,        -   0x1 is hexadecimal one and & is a bitwise and operation.

Further, in one example, chroma deblocking for a single tree verticaledge may be performed as follows:

-   -   1. The variable xN is set equal to Max(0, (nCbW/8)−1) and yN is        set equal to Max(0, (nCbH/8)−1).    -   2. The variable edgeSpacing is set equal to 8/SubWidthC.    -   3. The variable edgeSections is set equal to yN*(2/SubHeightC).    -   4. For xD_(k) equal to k*edgeSpacing with k=0 . . . xN and        yD_(m) equal to m<<2 with m=0 . . . edgeSections, the following        applies:        -   When (bS[xD_(k)*SubWidthC][yD_(m)*SubHeightC] is equal to 2            or (bS[xD_(k)*SubWidthC][yD_(m)*SubHeightC] is equal to 1            and nCbW (e.g. width in chroma samples) for coding block at            both location (xCb/SubWidthC, yCb/SubHeightC) and            (xCb/SubWidthC−1, yCb/SubHeightC) is greater than or equal            to 8)) and (((xCb/SubWidthC+xD_(k))>>3)<<3) is equal to            xCb/SubWidthC+xD_(k), the following ordered steps apply:            -   a. The decision process for chroma block edges as                specified below is invoked with treeType, the picture                sample array recPicture set equal to the chroma picture                sample array recPicture_(Cb), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_VER, the boundary filtering                strength bS[xD_(k)][yD_(m)], and the bit depth bD set                equal to BitDepth_(Cb) as inputs, and the decisions dE,                dEp and dEq, and the variable t_(C) as outputs.            -   b. The filtering process for chroma block edges as                specified below is invoked with the chroma picture                sample array recPicture_(Cb), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_VER and a variable                cQpPicOffset set equal to pps_cb_qp_offset as inputs,                and the modified chroma picture sample array                recPicture_(Cb) as output.            -   c. The decision process for chroma block edges as                specified below is invoked with treeType, the picture                sample array recPicture set equal to the chroma picture                sample array recPicture_(Cr), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_VER, the boundary            -   filtering strength bS[xD_(k)][yD_(m)], and the bit depth                bD set equal to BitDepth_(Cr) as inputs, and the                decisions dE, dEp and dEq, and the variable t_(C) as                outputs.            -   d. The filtering process for chroma block edges as                specified below is invoked with the chroma picture                sample array recPicture_(Cr), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_VER and a variable                cQpPicOffset set equal to pps_cb_qp_offset as inputs,                and the modified chroma picture sample array                recPicture_(Cr) as output.

Further, in one example, chroma deblocking for a single tree horizontaledge may be performed as follows:

-   -   1. The variable xN is set equal to Max(0, (nCbW/8)−1) and yN is        set equal to Max(0, (nCbH/8)−1).    -   2. The variable edgeSpacing is set equal to 8/SubHeightC.    -   3. The variable edgeSections is set equal to xN*(2/SubWidthC).    -   4. For yD_(m) equal to m*edgeSpacing with m=0 . . . yN and        xD_(k) equal to k<<2 with k=0 . . . edgeSections, the following        applies:        -   When (bS[xD_(k)*SubWidthC][yD_(m)*SubHeightC] is equal to 2,            or (bS[xD_(k)*SubWidthC yD_(m)*SubHeightC] is equal to 1 and            nCbH (e.g. height in chroma samples) for coding block at            both location (xCb/SubWidthC, yCb/SubHeightC)_(an)d            (xCb/SubWidthC, yCb/SubHeightC−1) is greater than or equal            to 8)) and (((yCb/SubHeightC+yD_(m))>>3)<<3) is equal to            yCb/SubHeightC+yD_(m), the following ordered steps apply:            -   a. The decision process for chroma block edges as                specified below is invoked with treeType, the picture                sample array recPicture set equal to the chroma picture                sample array recPicture_(Cb), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_HOR, the boundary filtering                strength bS[xD_(k)][yD_(m)], and the bit depth bD set                equal to BitDepth_(Cb) as inputs, and the decisions dE,                dEp and dEq, and the variable t_(C) as outputs.            -   b. The filtering process for chroma block edges as                specified below is invoked with the chroma picture                sample array recPicture_(Cb), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_HOR and a variable                cQpPicOffset set equal to pps_cb_qp_offset as inputs,                and the modified chroma picture sample array                recPicture_(Cb) as output.            -   c. The decision process for chroma block edges as                specified below is invoked with treeType, the picture                sample array recPicture set equal to the chroma picture                sample array recPicture_(Cr), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_HOR, the boundary filtering                strength bS[xD_(k)][yD_(m)], and the bit depth bD set                equal to BitDepth_(Cr) as inputs, and the decisions dE,                dEp and dEq, and the variable t_(C) as outputs.            -   d. The filtering process for chroma block edges as                specified below is invoked with the chroma picture                sample array recPicture_(Cr), the location of the chroma                coding block (xCb/SubWidthC, yCb/SubHeightC), the chroma                location of the block (xD_(k), yD_(m)), a variable                edgeType set equal to EDGE_HOR and a variable                cQpPicOffset set equal to pps_cr_qp_offset as inputs,                and the modified chroma picture sample array                recPicture_(Cr) as output.

In one example, the decision process for chroma block edges may be asfollows:

-   -   This process is only invoked when ChromaArrayType is not equal        to 0.    -   Inputs to this process are:        -   a chroma picture sample array s′,        -   a chroma location (xCb, yCb) specifying the top-left sample            of the current chroma coding block relative to the top-left            chroma sample of the current picture,        -   a chroma location (xB1, yB1) specifying the top-left sample            of the current chroma block relative to the top-left sample            of the current chroma coding block,        -   a variable edgeType specifying whether a vertical (EDGE_VER)            or a horizontal (EDGE_HOR) edge is filtered,        -   a variable cQpPicOffset specifying the picture-level chroma            quantization parameter offset.    -   Outputs of this process are        -   the variables dE, dEp and dEq containing decisions,        -   the variable tC.    -   If edgeType is equal to EDGE_VER, the values p_(i) and q_(i)        with i=0 . . . 1 and k=0 . . . 3 are derived as follows:

q _(i,k) =s′[xCb+xB1+i][yCb+yB1+k]

p _(i,k) =s′[xCb+xB1−i−1][yCb+yB1+k]

-   -   Otherwise (edgeType is equal to EDGE_HOR), the sample values        p_(i) and q_(i) with i=0 . . . 1 and k=0 . . . 3 are derived as        follows:

q _(i,k) =s′[xCb+xB1+k][yCb+yB1+i]

p _(i,k) =s′[xCb+xB1+k][yCb+yB1−i−1]

-   -   The variables Qp_(Q) and Qp_(P) are set equal to the Qp_(Y)        values of the coding units which include the coding blocks        containing the sample q_(0,0) and p_(0,0), respectively.    -   If ChromaArrayType is equal to 1, the variable Qp_(C) is        determined as specified in the Table illustrate in FIG. 6B based        on the index qPi derived as follows:

qPi=((Qp _(Q) +Qp _(P)+1)>>1)+cQpPicOffset

-   -   Otherwise (ChromaArrayType is greater than 1), the variable        Qp_(C) is set equal to Min(qPi, 63).    -   The value of the variable t_(C)′ is determined as specified in        the Table illustrate in FIG. 6B based on the chroma quantization        parameter Q derived as follows:

Q=Clip3(0,65,QP _(C)+2+(slice_tc_offset_div 2<<1))

-   -   where slice_tc_offset_div 2 is the value of the syntax element        slice_tc_offset_div 2 for the slice that contains sample        q_(0,0).    -   The variable t_(C) is derived as follows:

t _(C) =t _(C)′*(1<<(BitDepth_(C)−8))

-   -   Depending on the value of edgeType, the following applies:        -   If edgeType is equal to EDGE_VER, the following ordered            steps apply:            -   1. The variables dpq0, dpq1, dp, dq and d are derived as                follows:

dp0=Abs(p _(2,0)−2*p _(1,0) +p _(0,0))

dp1=Abs(p _(2,1)−2*p _(1,1) +p _(0,1))

dq0=Abs(q _(2,0)−2*q _(1,0) +q _(0,0))

dq1=Abs(q _(2,1)−2*q _(1,1) +q _(0,1))

dpq0=dp0+dq0

dpq1=dp1+dq1

dp=dp0+dp1

dq=dq0+dq1

d=dpq0+dpq1

-   -   -   -   2. The variables dE, dEp and dEq are set equal to 0.            -   3. When d is less than β, the following ordered steps                apply:                -   a. The variable dpq is set equal to 2*dpq0.                -   b. For the sample location (xCb+xB1, yCb+yB1), the                    decision process for a chroma sample as specified                    below is invoked with sample values p_(0,0),                    p_(3,0), q_(0,0), and q_(3,0), the variables dpq, β                    and t_(C) as inputs, and the output is assigned to                    the decision dSam0.                -   c. The variable dpq is set equal to 2*dpq1.                -   d. For the sample location (xCb+xB1, yCb+yB1+3), the                    decision process for a chroma sample as specified                    below is invoked with sample values p_(0,1),                    p_(3,1), q_(0,1), and q_(3,1), the variables dpq, β                    and t_(C) as inputs, and the output is assigned to                    the decision dSam1.                -   e. The variable dE is set equal to 1.                -   f. When dSam0 is equal to 1 and dSam1 is equal to 1,                    the variable dE is set equal to 2.                -   g. When dp is less than (β+(β>>1))>>3, the variable                    dEp is set equal to 1.                -   h. When dq is less than (β+(β>>1))>>3, the variable                    dEq is set equal to 1.

        -   Otherwise (edgeType is equal to EDGE_HOR), the following            ordered steps apply:            -   1. The variables dpq0, dpq3, dp, dq and d are derived as                follows:

dp0=Abs(p _(2,0)−2*p _(1,0) +p _(0,0))

dp1=Abs(p _(2,1)−2*p _(1,1) +p _(0,1))

dq0=Abs(q _(2,0)−2*q _(1,3) +q _(0,0))

dq3=Abs(q _(2,1)−2*q _(1,1) +q _(0,1))

dpq0=dp0+dq0

dpq1=dp1+dq1

dp=dp0+dp1

dq=dq0+dq1

d=dpq0+dpq1

-   -   -   -   2. The variables dE, dEp and dEq are set equal to 0.            -   3. When d is less than 13, the following ordered steps                apply:                -   a. The variable dpq is set equal to 2*dpq0.                -   b. For the sample location (xCb+xB1, yCb+yB1), the                    decision process for a chroma sample as specified                    below is invoked with sample values p_(0,0),                    p_(1,0), q_(0,0) and q_(1,3), the variables dpq, β                    and t_(C) as inputs, and the output is assigned to                    the decision dSam0.                -   c. The variable dpq is set equal to 2*dpq1.                -   d. For the sample location (xCb+xB1+3, yCb+yB1), the                    decision process for a chroma sample as specified                    below is invoked with sample values p_(0,1),                    p_(3,1), q_(0,1) and q_(3,1), the variables dpq, β                    and t_(C) as inputs, and the output is assigned to                    the decision dSam1.                -   e. The variable dE is set equal to 1.                -   f. When dSam0 is equal to 1 and dSam1 is equal to 1,                    the variable dE is set equal to 2.                -   g. When dp is less than (β+(β>>1))>>3, the variable                    dEp is set equal to 1.

    -   When dq is less than (+(β>>1))>>3, the variable dEq is set equal        to 1.

In one example, the decision process for a chroma sample may be asfollows:

-   -   Inputs to this process are:        -   the sample values p₀, p₃, q₀ and q₃,        -   the variables dpq, β and t_(C).    -   Output of this process is the variable dSam containing a        decision.        -   The variable dSam is specified as follows:        -   If dpq is less than (β>>2), Abs(p₃−p₀)+Abs(q₀−q₃) is less            than (β>>3) and Abs(p₀−q₀) is less than (5*t_(C)+1)>>1, dSam            is set equal to 1.            -   Otherwise, dSam is set equal to 0.

In one example, the filtering process for chroma block edges may be asfollows:

-   -   This process is only invoked when ChromaArrayType is not equal        to 0.    -   Inputs to this process are:        -   a chroma picture sample array s′,        -   a chroma location (xCb, yCb) specifying the top-left sample            of the current chroma coding block relative to the top-left            chroma sample of the current picture,        -   a chroma location (xB1, yB1) specifying the top-left sample            of the current chroma block relative to the top-left sample            of the current chroma coding block,        -   a variable edgeType specifying whether a vertical (EDGE_VER)            or a horizontal (EDGE_HOR) edge is filtered,        -   a variable cQpPicOffset specifying the picture-level chroma            quantization parameter offset.    -   Output of this process is the modified chroma picture sample        array s′.    -   Depending on the value of edgeType, the following applies:        -   If edgeType is equal to EDGE_VER, for each sample location            (xCb+xB1, yCb+yB1+k), k=0 . . . 3, the following ordered            steps apply:        -   1. The filtering process for a chroma sample as specified            below is invoked with the sample values p_(i,k), q_(i,k),            with i=0 . . . 1, the locations (xCb+xB1−1, yCb+yB1+k) and            (xCb+xB1, yCb+yB1+k) and the variable t_(C) as inputs, and            the filtered sample values p₀′ and q₀′ as outputs.        -   2. The filtered sample values p₀′ and q₀′ replace the            corresponding samples inside the sample array s′ as follows:

s′[xCb+xB1][yCb+yB1+k]=q ₀′

s′[xCb+xB1−1][yCb+yB1+k]=p ₀′

-   -   -   Otherwise (edgeType is equal to EDGE_HOR), for each sample            location (xCb+xB1+k, yCb+yB1), k=0 . . . 3, the following            ordered steps apply:            -   1. The filtering process for a chroma sample as                specified below is invoked with the sample values                p_(i,k), q_(i,k), with i=0 . . . 1, the locations                (xCb+xB1+k, yCb+yB1−1) and (xCb+xB1+k, yCb+yB1), and the                variable t_(C) as inputs, and the filtered sample values                p₀′ and q₀′ as outputs.            -   2. The filtered sample values p₀′ and q₀′ replace the                corresponding samples inside the sample array s′ as                follows:

s′[xCb+xB1+k][yCb+yB1]=q ₀′

s′[xCb+xB1+k][yCb+yB1−1]=p ₀′

In one example, the filtering process for a chroma sample may be asfollows:

-   -   This process is only invoked when ChromaArrayType is not equal        to 0.    -   Inputs to this process are:        -   the chroma sample values p_(i) and q_(i) with i=0 . . . 3,        -   the chroma locations of p_(i) and q_(i), (xP_(i), yP_(i))            and (xQ_(i), yQ_(i)),        -   a variable t_(C).    -   Outputs of this process are:        -   the number of filtered samples nDp and nDq,        -   the filtered sample values p: and with i=0 . . . nDp−1, j=0            . . . nDq−1.    -   Depending on the value of dE, the following applies:        -   If the variable dE is equal to 2, nDp and nDq are both set            equal to 3 and the following strong filtering applies:

p ₀′=Clip3(p ₀ −t _(C) ,p ₀ +t _(C),(p ₃ +p ₂ +p ₁+2*p ₀ +q ₀ +q ₁ +q₂+4)>>3)

p ₁′=Clip3(p ₁ −t _(C),(2*p ₃ +p ₂₊₂ *p ₁ +p ₀ +q ₀ +q ₁+4)>>3)

p ₂′=Clip3(p ₂ −t _(C) ,p ₂ +t _(C),(3*p ₃+2*p ₂ +p ₁ +p ₀ +q ₀+4)>>3)

q ₀′=Clip3(q ₀ −t _(C) ,q ₀ +t _(C),(p ₂ +p ₁ +p ₀+2*q ₀ +q ₁ +q ₂ +q₃+4)>>3)

q ₁′=Clip3(q ₁ −t _(C) ,q ₁ +t _(C),(p ₁ +p ₀ +q ₀+2*q ₁ +q ₂+2*q₃+4)>>3)

q ₂′=Clip3(q ₂ −t _(C) ,q ₂ +t _(C),(p ₀ +q ₀ +q ₁+2*q ₂+3*q ₃+4)>>3)

-   -   -   -   Otherwise, nDp and nDq are set both equal to 0 and the                following weak filtering applies: Δ=Clip3(−t_(C), t_(C),                ((((q₀−p₀)<<2)+p₁−q₁+4)>>3))

p ₀′=Clip1_(C)(p ₀+Δ)

q ₀′=Clip1_(C)(q ₀−Δ)

Further, in one example, luma deblocking for vertical edge may beperformed as follows:

-   -   When treeType is equal to SINGLE_TREE or DUAL_TREE_LUMA, the        filtering process for edges in the luma coding block of the        current coding unit consists of the following ordered steps:        -   1. The variable xN is set equal to Max(0, (nCbW/8)−1) and yN            is set equal to (nCbH/4)−1.        -   2. For xD_(k) equal to k<<3 with k=0 . . . nN and yD_(m)            equal to m<<2 with m=0 . . . yN, the following applies:            -   When bS[xD_(k)][yD_(m)] is greater than 0, the following                ordered steps apply:                -   a. The decision process for block edges as specified                    in clause below is invoked with treeType, the                    picture sample array recPicture set equal to the                    luma picture sample array recPicture_(L), the                    location of the luma coding block (xCb, yCb), the                    luma location of the block (xD_(k), yD_(m)), a                    variable edgeType set equal to EDGE_VER, the                    boundary filtering strength bS[xD_(k)][yD_(m)], the                    max filter lengths maxFilterLengthP[xD_(k)][yD_(m)]                    and maxFilterLengthQ[xD_(k)][yD_(m)] and the bit                    depth bD set equal to BitDepth_(Y) as inputs, and                    the decisions dE, dEp and dEq, the max filter                    lengths maxFilterLengthP and maxFilterLengthQ, and                    the variable t_(C) as outputs.                -   b. The filtering process for block edges as                    specified in clause below is invoked with the                    picture sample array recPicture set equal to the                    luma picture sample array recPicture_(L), the                    location of the luma coding block (xCb, yCb), the                    luma location of the block (xD_(k), yD_(m)), a                    variable edgeType set equal to EDGE_VER, the                    decisions dE, dEp and dEq, the max filter lengths                    maxFilterLengthP and maxFilterLengthQ and the                    variable t_(C) as inputs, and the modified luma                    picture sample array recPicture_(L) as output.

Further, in one example, luma deblocking for horizontal edge may beperformed as follows:

-   -   When treeType is equal to SINGLE_TREE or DUAL_TREE_LUMA, the        filtering process for edges in the luma coding block of the        current coding unit consists of the following ordered steps:        -   1. The variable yN is set equal to Max(0, (nCbH/8)−1) and xN            is set equal to (nCbW/4)−1.        -   2. For yD_(m) equal to m<<3 with m=0 . . . yN and xD_(k)            equal to k<<2 with k=0 . . . xN, the following applies:            -   When bS[xD_(k)][yD_(m)] is greater than 0, the following                ordered steps apply:                -   a. The decision process for block edges as specified                    below is invoked with treeType, the picture sample                    array recPicture set equal to the luma picture                    sample array recPicture_(L), the location of the                    luma coding block (xCb, yCb), the luma location of                    the block (xD_(k), yD_(m)), a variable edgeType set                    equal to EDGE_HOR, the boundary filtering strength                    bS[xD_(k)] [yD_(m)], the max filter lengths                    maxFilterLengthP[xD_(k)][yD_(m)] and                    maxFilterLengthQ[xD_(k)][yD_(m)], and the bit depth                    bD set equal to BitDepth_(y) as inputs, and the                    decisions dE, dEp and dEq, the max filter lengths                    maxFilterLengthP and maxFilterLengthQ, and the                    variable t_(C) as outputs.                -   b. The filtering process for block edges as                    specified below is invoked with the picture sample                    array recPicture set equal to the luma picture                    sample array recPicture_(L), the location of the                    luma coding block (xCb, yCb), the luma location of                    the block (xD_(k), yD_(m)), a variable edgeType set                    equal to EDGE_HOR, the decisions dEp, dEp and dEq,                    the max filter lengths maxFilterLengthP and                    maxFilterLengthQ, and the variable t_(C) as inputs,                    and the modified luma picture sample array                    recPicture_(L) as output.

In one example, the decision process for luma block edges may be asfollows:

-   -   Inputs to this process are:        -   a variable treeType specifying whether a single tree            (SINGLE_TREE) or a dual tree is used to partition the CTUs            and, when a dual tree is used, whether the luma            (DUAL_TREE_LUMA) or chroma components (DUAL_TREE_CHROMA) are            currently processed,        -   a picture sample array recPicture,        -   a location (xCb, yCb) specifying the top-left sample of the            current coding block relative to the top-left sample of the            current picture,        -   a location (xB1, yB1) specifying the top-left sample of the            current block relative to the top-left sample of the current            coding block,        -   a variable edgeType specifying whether a vertical (EDGE_VER)            or a horizontal (EDGE_HOR) edge is filtered,        -   a variable bS specifying the boundary filtering strength,        -   a variable maxFilterLengthP specifying the max filter length            on P side        -   a variable maxFilterLengthQ specifying the max filter length            on Q side        -   a variable bD specifying the bit depth of the current            component.    -   Outputs of this process are:        -   the variables dE, dEp and dEq containing decisions,        -   the variables maxFilterLengthP and maxFilterLengthQ with            modified filter lengths for P and Q side respectively        -   the variable t_(C).    -   If edgeType is equal to EDGE_VER, the sample values p_(i,k) and        q_(j,k) with i=0 . . . maxFilterLengthP and j=0 . . .        maxFilterLengthQ and k=0 and 3 are derived as follows:

q _(i,k)=recPicture_(L)[xCb+xB1+i][yCb+yB1+k]

p _(i,k)=recPicture_(L)[xCb+xB1−i−1][yCb+yB1+k]

-   -   Otherwise (edgeType is equal to EDGE_HOR), the sample values        p_(i,k) and q_(j,k) with i=0 . . . maxFilterLengthP and j=0 . .        . maxFilterLengthQ and k=0 and 3 are derived as follows:

q _(i,k)=recPicture[xCb+xB1+k][yCb+yB1+i]

p _(i,k)=recPicture[xCb+xB1+k][yCb+yB1−i−1]

-   -   -   The variable qpOffset is derived as follows:        -   If sps_ladf_enabled_flag is equal to 1 and treeType is equal            to SINGLE_TREE or DUAL_TREE_LUMA, the following applies:        -   The variable lumaLevel of the reconstructed luma level is            derived as follow:

lumaLevel=((p0,0+p0,3+q0,0+q0,3)>>2),

-   -   -   The variable gpOffset is set equal to            sps_ladf_lowest_interval_qp_offset and modified as follows:

for( i = 0; i < sps_num_ladf_intervals_minus2 + 1; i++ ) { if(lumaLevel > SpsLadfIntervalLowerBound[ i + 1 ]) qpOffset =sps_ladf_qp_offset[ i ] else break }

-   -   -   Otherwise (treeType is equal to DUAL_TREE_CHROMA), qpOffset            is set equal to 0.

    -   The variables Qp_(Q) and Qp_(P) are derived as follows:        -   If treeType is equal to SINGLE_TREE or DUAL_TREE_LUMA,            Qp_(Q) and Qp_(P) are set equal to the Qp_(Y) values of the            coding units which include the coding blocks containing the            sample q_(0,0) and p_(0,0), respectively.        -   Otherwise (treeType is equal to DUAL_TREE_CHROMA), Qp_(Q)            and Qp_(P) are set equal to the Qp_(C) values of the coding            units which include the coding blocks containing the sample            q_(0,0) and p_(0,0), respectively.

    -   The variable qP is derived as follows:

qP=((Qp _(Q) +Qp _(P)+1)>>1)+qpOffset

-   -   The value of the variable 13′ is determined as specified in        Table 8-18 based on the quantization parameter Q derived as        follows:

Q=Clip3(0,63,qP+(slice_beta_offset_div 2<<1))

-   -   where slice_beta_offset_div 2 is the value of the syntax element        slice_beta_offset_div 2 for the slice that contains sample        q_(0,0).    -   The variable β is derived as follows:

β=β′*(1<<(bD−8))

-   -   The value of the variable t_(C)′ is determined as specified in        the Table illustrated in FIG. 6B based on the quantization        parameter Q derived as follows:

Q=Clip3(0,65,qP+2*(bS−1)+(slice_tc_offset_div 2<<1))

-   -   where slice_tc_offset_div 2 is the value of the syntax element        slice_tc_offset_div 2 for the slice that contains sample        q_(0,0).    -   The variable t_(C) is derived as follows:

t _(C) =t _(C)′*(1<<(bD−8))

-   -   Depending on the value of edgeType, the following applies:        -   If edgeType is equal to EDGE_VER, the following ordered            steps apply:            -   1. The variables dp0, dp3, dq0 and dq3 are derived as                follows.

dp0=Abs(p _(2,0)−2*p _(1,0) +p _(0,0))

dp3=Abs(p _(2,3)−2*p _(1,3) +p _(0,3))

dq0=Abs(q _(2,0)−2*q _(1,0) +q _(0,0))

dq3=Abs(q _(2,3)−2*q _(1,3) +q _(0,3))

-   -   -   -   2. The variables bSidePisLargeBlk and bSideQisLargeBlk                are derived as follows:                -   If p_(0,0) belongs to coding block with width in                    luma samples greater than or equal to 32,                    bSidePisLargeBlk is set equal to 1 otherwise                    bSidePisLargeBlk is set equal to 0.                -   If q_(0,0) belongs to coding block with width in                    luma samples greater than or equal to 32,                    bSideQisLargeBlk is set equal to 1 otherwise                    bSideQisLargeBlk is set equal to 0.            -   3. If both bSidePisLargeBlk and bSideQisLargeBlk is                equal to 0 go to step 6.            -   4. The variables dpq0L, dpq3L and dL are derived as                follows:                -   If bSidePisLargeBlk is equal to 1

dp0L=(dp0+Abs(p _(5,0)−2*p _(4,0) +p _(3,0))+1)>>1

dp3L=(dp3+Abs(p _(5,3)−2*p _(4,3) +p _(3,3))+1)>>1

Otherwise

dp0L=dp0

dp3L=dp3

-   -   -   -   -   If bSideQisLargeBlk is equal to 1

dq0L=(dq0+Abs(q _(5,0)−2*q _(4,0) +q _(3,0))+1)>>1

dq3L=(dq3+Abs(q _(5,3)−2*q _(4,3) +q _(3,3))+1)>>1

Otherwise

dq0L=dq0

dq3L=dq3

dpq0L=dp0L+dq0L

dpq3L=dp3L+dq3L

dL=dpq0L+dpq3L

-   -   -   -   5. If dL is less than β, the following ordered steps                apply otherwise go to step 6:                -   a. The variable dpq is set equal to 2*dpq0L.                -   b. The variables sp0, sq0 and spq0 are derived as                    follows:

sp0=Abs(p _(3,0) −p _(0,0))

sq0=Abs(q _(0,0) −q _(3,0))

spq0=Abs(p _(0,0) −q _(0,0))

-   -   -   -   -   c. The variable sp is set equal to sp0, the variable                    sq is set equal to sq0 and the variable spq is set                    equal to spq0.                -   d. When bSidePisLargeBlk is equal to 1 or                    bSidePisLargeBlk is equal to 1, the sample values p₀                    p₃ q₀ and q₃ are derived as follows                -    If bSidePisLargeBlk

p ₃ =p _(0,3)

p ₀ =p _(0,maxFilterLengthP)

-   -   -   -   -    If bSideQisLargeBlk

q ₃ =q _(0,3)

q ₀ =q _(0,maxFilterLengthQ)

-   -   -   -   -    Otherwise, set p₀ p₃ q₀ and q₃ to 0                -   e. For the sample location (xCb+xB1, yCb+yB1), the                    decision process for a sample as specified below                    invoked with sample values p₀, p₁, q₀, and q₃, dpq,                    sp, sq, spq, bSidePisLargeBlk, bSideQisLargeBlk, β                    and t_(C) as inputs, and the output is assigned to                    the decision dSam0.                -   f. The variable dpq is set equal to 2*dpq3L.                -   g. The variables sp3, sq3 and spq3 are derived as                    follows:

sp3=Abs(p _(3,3) −p _(0,3))

sq3=Abs(q _(0,3) −q _(3,3))

spq3=Abs(p _(0,3) −q _(0,3))

-   -   -   -   -   h. The variable sp is set equal to sp3, the variable                    sq is set equal to sq3 and the variable spq is set                    equal to spq3.                -   i. When bSidePisLargeBlk is equal to 1 or                    bSidePisLargeBlk is equal to 1, the sample values p₀                    p₃ q₀ and q₃ are derived as follows                -    If bSidePisLargeBlk

p ₃ =p _(3,3)

p ₀ =p _(3,maxFilterLengthP)

-   -   -   -   -    If bSideQisLargeBlk

q ₃ =q _(3,3)

q ₀ =q _(3,maxFilterLengthQ)

-   -   -   -   -    Otherwise, set p₀ p₃ q₀ and q₃ to 0                -   j. For the sample location (xCb+xB1, yCb+yB1+3), the                    decision process for a sample as specified below is                    invoked with sample values p_(a), p₃, q₀ and q₃, the                    variables dpq, sp, sq, spq, bSidePisLargeBlk,                    bSideQisLargeBlk, β and t_(C) as inputs, and the                    output is assigned to the decision dSam3.                -   k. When dSam0 is equal to 1 and dSam3 is equal to 1,                    the variable dE is set equal to 3 and omit steps 6                    to 8.

            -   6. The variables maxFilterLengthP, maxFilterLengthQ,                dpq0, dpq3, dp, dq and d are derived as follows:

dpq0=dp0+dq0

dpq3=dp3+dq3

dp=dp0+dp3

dq=dq0+dq3

d=dpq0+dpq3

maxFilterLengthP=3

maxFilterLengthQ=3

-   -   -   -   7. The variables dE, dEp and dEq are set equal to 0.            -   8. When d is less than β, the following ordered steps                apply:                -   a. The variable dpq is set equal to 2*dpq0.                -   b. For the sample location (xCb+xB1, yCb+yB1), the                    decision process for a sample as specified below is                    invoked with sample values 0, 0, 0, and 0, the                    variables dpq, sp, sq, spq, bSidePisLargeBlk,                    bSideQisLargeBlk, β and t_(C) as inputs, and the                    output is assigned to the decision dSam0.                -   c. The variable dpq is set equal to 2*dpq3.                -   d. For the sample location (xCb+xB1, yCb+yB1+3), the                    decision process for a sample as specified below is                    invoked with sample values 0, 0, 0, and 0, the                    variables dpq, sp, sq, spq, bSidePisLargeBlk,                    bSideQisLargeBlk, β and t_(C) as inputs, and the                    output is assigned to the decision dSam3.                -   e. The variable dE is set equal to 1.                -   f. When dSam0 is equal to 1 and dSam3 is equal to 1,                    the variable dE is set equal to 2.                -   g. When dp is less than (β+(β>>1))>>3, the variable                    dEp is set equal to 1.                -   h. When dq is less than (β+(β>>1))>>3, the variable                    dEq is set equal to 1.

        -   Otherwise (edgeType is equal to EDGE_HOR), the following            ordered steps apply:            -   1. The variables dp0, dp3, dq0 and dq3 are derived as                follows

dp0=Abs(p _(2,0)−2*p _(1,0) +p _(0,0))

dp3=Abs(p _(2,3)−2*p _(1,3) +p _(0,3))

dq0=Abs(q _(2,0)−2*q _(1,0) +q _(0,0))

dq3=Abs(q _(2,3)−2*q _(1,3) +q _(0,3))

-   -   -   -   2. The variables bSidePisLargeBlk and bSideQisLargeBlk                are derived as follows:                -   If edgeType is EDGE_HOR, and y position of luma                    position of sample p0,0 modulo                -   CtbSizeY is 0, set bSidePisLargeBlk is set to 0                -   Otherwise, If p_(0,0) belongs to coding block with                    height greater than or equal to 32,                -   bSidePisLargeBlk is set equal to 1 otherwise                    bSidePisLargeBlk is set equal to 0.                -    If q_(0,0) belongs to coding block with height                    greater than or equal to 32,                -   bSideQisLargeBlk is set equal to 1 otherwise                    bSideQisLargeBlk is set equal to 0.            -   3. If both bSidePisLargeBlk and bSideQisLargeBlk is                equal to 0 go to step 6.            -   4. The variables dpq0L, dpq3L and dL are derived as                follows:                -   If bSidePisLargeBlk is equal to 1

dp0L=(dp0+Abs(p _(5,0)−2*p _(4,0) +p _(3,0))+1)>>1

dp3L=(dp3+Abs(p _(5,3)−2*p _(4,3) +p _(3,3))+1)>>1

Otherwise

dp0L=dp0

dp3L=dp3

-   -   -   -   -    If bSideQisLargeBlk is equal to 1

dq0L=(dq0+Abs(q _(5,0)−2*q _(4,0) +q _(3,0))+1)>>1

dq3L=(dq3+Abs(q _(5,3)−2*q _(4,3) +q _(3,3))+1)>>1

Otherwise

dq0L=dq0

dq3L=dq3

dpq0L=dp0L+dq0L

dpq3L=dp3L+dq3L

dL=dpq0L+dpq3L

-   -   -   -   5. When dL is less than β, the following ordered steps                apply otherwise go to step 6:                -   a. The variable dpq is set equal to 2*dpq0L.                -   b. The variables sp0, sq0 and spq0 are derived as                    follows:

sp0=Abs(p _(3,0) −p _(0,0))

sq0=Abs(q _(0,0) −q _(3,0))

spq0=Abs(p _(0,0) −q _(0,0))

-   -   -   -   -   c. The variable sp is set equal to sp0, the variable                    sq is set equal to sq0 and the variable spq is set                    equal to spq0.                -   d. When bSidePisLargeBlk is equal to 1 or                    bSidePisLargeBlk is equal to 1, the variable p₀ p₃                    q₀ and q₃ are derived as follows                -    If bSidePisLargeBlk

p ₃ =p _(0,3)

p ₀ =p _(0,maxFilterLength) P

-   -   -   -   -    If bSideQisLargeBlk

q ₃ =q _(0,3)

q ₀ =q _(0,maxFilterLength) Q

-   -   -   -   -    Otherwise, set p₀ p₃ q₀ and q₃ to 0                -   e. For the sample location (xCb+xB1, yCb+yB1), the                    decision process for a sample as specified in clause                    below is invoked with sample values p₀, p₃, q₀ and                    q₃, the variables dpq, sp, sq, spq,                    bSidePisLargeBlk, bSideQisLargeBlk, β and t_(C) as                    inputs, and the output is assigned to the decision                    dSam0.                -   f. The variable dpq is set equal to 2*dpq3L.                -   g. The variables sp3, sq3 and spq3 are derived as                    follows:

sp3=Abs(p _(3,3) −p _(0,3))

sq3=Abs(q _(0,3) −q _(3,3))

spq3=Abs(p _(0,3) −q _(0,3))

-   -   -   -   -   h. The variable sp is set equal to sp3, the variable                    sq is set equal to sq3 and the variable spq is set                    equal to spq3.                -   i. When bSidePisLargeBlk is equal to 1 or                    bSidePisLargeBlk is equal to 1, the variable p₀, p₃,                    q₀ and q₃ are derived as follows                -    If bSidePisLargeBlk

p ₃ =p _(3,3)

p ₀ =p _(3,maxFilterLength) P

-   -   -   -   -    If bSideQisLargeBlk

q ₃ =q _(3,3)

q ₀ =q _(3,maxFilterLength) Q

-   -   -   -   -    Otherwise, set to p₀, p₃, q₀ and q₃ to 0                -   j. For the sample location (xCb+xB1+3, yCb+yB1), the                    decision process for a sample as specified in clause                    below is invoked with sample values p₀, p₃, q₀ and                    q₃, the variables dpq, sp, sq, spq,                    bSidePisLargeBlk, bSideQisLargeBlk, β and t_(C) as                    inputs, and the output is assigned to the decision                    dSam3.                -   k. When dSam0 is equal to 1 and dSam3 is equal to 1,                    the variable dE is set equal to 3 and omit steps 6                    to 8.

            -   6. The variables maxLengthP, maxLengthQ, dpq0, dpq3, dp,                dq and d are derived as follows:

dpq0=dp0+dq0

dpq3=dp3+dq3

dp=dp0+dp3

dq=dq0+dq3

d=dpq0+dpq3

maxLengthP=3

maxLengthQ=3

-   -   -   -   7. The variables dE, dEp and dEq are set equal to 0.            -   8. When d is less than β, the following ordered steps                apply:                -   a. The variable dpq is set equal to 2*dpq0.                -   b. For the sample location (xCb+xB1, yCb+yB1), the                    decision process for a sample as specified in clause                    below is invoked with sample values 0, 0, 0 and 0,                    the variables dpq, sp, sq, spq, bSidePisLargeBlk,                    bSideQisLargeBlk, β and t_(C) as inputs, and the                    output is assigned to the decision dSam0.                -   c. The variable dpq is set equal to 2*dpq3.                -   d. For the sample location (xCb+xB1+3, yCb+yB1), the                    decision process for a sample as specified in clause                    below is invoked with sample values 0, 0, 0 and 0,                    the variables dpq, sp, sq, spq, bSidePisLargeBlk,                    bSideQisLargeBlk, β and t_(C) as inputs, and the                    output is assigned to the decision dSam3.                -   e. The variable dE is set equal to 1.                -   f. When dSam0 is equal to 1 and dSam3 is equal to 1,                    the variable dE is set equal to 2.                -   g. When dp is less than (β+(β>>1))>>3, the variable                    dEp is set equal to 1.                -   h. When dq is less than (β+(β>>1))>>3, the variable                    dEq is set equal to 1.

It should be noted that variable CtbSizeY may be defined as follows: Thearray size for each luma CTB in both width and height is CtbSizeY inunits of samples. The width and height of the array for each chroma CTBare CtbWidthC and CtbHeightC, respectively, in units of samples.

In one example, the decision process for a luma sample may be asfollows:

-   -   Inputs to this process are:        -   the sample values p₀, p₃, q₀ and q₃,        -   the variables sp, sq, dpq, β and t_(C), bSidePisLargeBlk and            bSideQisLargeBlk.    -   Output of this process is the variable dSam containing a        decision.    -   The variables sp and sq are modified as follows:    -   If bSidePisLargeBlk

sp=(sp+Abs(p ₃ −p ₀)+1)>>1

-   -   If bSideQisLargeBlk

sq=(sq+Abs(q ₃ −q ₀)+1)>>1

-   -   The variable sthr is derived as follows:    -   If bSidePisLargeBlk or bSidePisLargeBlk

sthr=3*β>>5

Otherwise

sthr=β>>3

-   -   The variable dSam is specified as follows:        -   If dpq is less than (β>>2), sp+sq is less than sthr and spq            is less than (5*t_(C)+1)>>1, dSam is set equal to 1.        -   Otherwise, dSam is set equal to 0.

In one example, the filtering process for luma block edges may be asfollows:

-   -   Inputs to this process are:        -   a picture sample array recPicture,        -   a location (xCb, yCb) specifying the top-left sample of the            current coding block relative to the top-left sample of the            current picture,        -   a location (xB1, yB1) specifying the top-left sample of the            current block relative to the top-left sample of the current            coding block,        -   a variable edgeType specifying whether a vertical (EDGE_VER)            or a horizontal (EDGE_HOR) edge is filtered,        -   the variables dE, dEp and dEq containing decisions,        -   the variables maxLengthP and maxLengthQ containing filter            lengths,        -   the variable t_(C).    -   Output of this process is the modified picture sample array        recPicture.    -   Depending on the value of edgeType, the following applies:        -   If edgeType is equal to EDGE_VER, the following ordered            steps apply:            -   1. The sample values p_(i,k) and q_(j,k) with i=0 . . .                maxLengthP, j=0 . . . maxLengthQ and k=0 . . . 3 are                derived as follows:

Q _(j,k)=recPicture_(L)[xCb+xB1+j][yCb+yB1+k]

p _(i,k)=recPicture_(L)[xCb+xB1−i−1][yCb+yB1+k]

-   -   -   -   2. When dE is not equal to 0 and dE is not equal to 3,                for each sample location (xCb+xB1, yCb+yB1+k), k=0 . . .                3, the following ordered steps apply:                -   a. The filtering process for a luma sample as                    specified below is invoked with the sample values                    p_(i,k), q_(i,k) with i=0 . . . 3, the locations                    (xP_(i), yP_(i)) set equal to (xCb+xB1−i−1,                    yCb+yB1+k) and (xQ_(i), yQ_(i)) set equal to                    (xCb+xB1+i, yCb+yB1+k) with i=0 . . . 2, the                    decision dE, the variables dEp and dEq and the                    variable t_(C) as inputs, and the number of filtered                    samples nDp and nDq from each side of the block                    boundary and the filtered sample values p_(i)′ and                    q_(j)′ as outputs.                -   b. When nDp is greater than 0, the filtered sample                    values p_(i)′ with i=0 . . . nDp−1 replace the                    corresponding samples inside the sample array                    recPicture as follows:

recPicture[xCb+xB1−i−1][yCb+yB1+k]=p _(i)′

-   -   -   -   -   c. When nDq is greater than 0, the filtered sample                    values q_(j)′ with j=0 . . . nDq−1 replace the                    corresponding samples inside the sample array                    recPicture as follows:

recPicture[xCb+xB1+j][yCb+yB1+k]=q _(j′)

-   -   -   -   3. When dE is equal to 3, for each sample location                (xCb+xB1, yCb+yB1+k), k=0 . . . 3, the following ordered                steps apply:                -   a. The filtering process for a luma sample using                    long filters below is invoked with the sample values                    p_(i,k), q_(j,k) with i=0 . . . maxFilterLengthP and                    j=0 . . . maxFilterLengthQ, the locations (xP_(i),                    yP_(i)) set equal to (xCb+xB1−i−1, yCb+yB1+k) and                    (xQ_(j), yQ_(j)) set equal to (xCb+xB1+j, yCb+yB1+k)                    with i=0 . . . maxFilterLengthP−1 and j=0 . . .                    maxFilterLengthQ−1, the variables maxFilterLengthP,                    maxFilterLengthQ and t_(C) as inputs and the                    filtered samples values p_(i)′ and q_(j)′ as                    outputs.                -   b. With the filtered sample values n′ with i=0 . . .                    maxFilterLengthP−1 replace the corresponding samples                    inside the sample array recPicture as follows:

recPicture[xCb+xB1−i−1][yCb+yB1+k]=p _(i)′

-   -   -   -   -   c. With the filtered sample values q: with j=0 . . .                    maxFilterLengthQ−1 replace the corresponding samples                    inside the sample array recPicture as follows:

recPicture[xCb+xB1+j][yCb+yB1+k]=q _(j)′

-   -   -   Otherwise (edgeType is equal to EDGE_HOR), the following            ordered steps apply:            -   1. The sample values p_(i,k) and q_(j,k) with i=0 . . .                maxLengthP, j=0 . . . maxLengthQ and k=0 . . . 3 are                derived as follows:

q _(ijk)=recPicture_(L)[xCb+xB1+k][yCb+yB1+j]

p _(i,k)=recPicture_(L)[xCb+xB1+k][yCb+yB1−i−1]

-   -   -   -   2. When dE is not equal to 0 and dE is not equal to 3,                for each sample location (xCb+xB1+k, yCb+yB1), k=0 . . .                3, the following ordered steps apply:                -   a. The filtering process for a sample as specified                    below is invoked with the sample values p_(i,k),                    q_(j,k) with i=0 . . . 3, the locations (xP_(i),                    yP_(i)) set equal to (xCb+xB1+k, yCb+yB1−i−1) and                    (xQ_(i), yQ_(i)) set equal to (xCb+xB1+k, yCb+yB1+i)                    with i=0 . . . 2, the decision dE, the variables dEp                    and dEq, and the variable t_(C) as inputs, and the                    number of filtered samples nDp and nDq from each                    side of the block boundary and the filtered sample                    values p_(i)′ and q_(j)′ as outputs.                -   b. When nDp is greater than 0, the filtered sample                    values p_(i)′ with i=0 . . . nDp−1 replace the                    corresponding samples inside the sample array                    recPicture as follows:

recPicture[xCb+xB1+k][yCb+yB1−i−1]=p _(i)′

-   -   -   -   -   c. When nDq is greater than 0, the filtered sample                    values with j=0 . . . nDq−1 replace the                    corresponding samples inside the sample array                    recPicture as follows:

recPicture[xCb+xB1+k][yCb+yB1+j]=q _(j)′

-   -   -   -   3. When dE is equal to 3, for each sample location                (xCb+xB1+k, yCb+yB1), k=0 . . . 3, the following ordered                steps apply:                -   a. The filtering process for a luma sample using                    long filters below is invoked with the sample values                    p_(i,k), q_(j,k) with i=0 . . . maxFilterLengthP and                    j=0 . . . maxFilterLengthQ, the locations (xP_(i),                    yP_(i)) set equal to (xCb+xB1+k, yCb+yB1−i−1) and                    (xQ_(j), yQ_(j)) set equal to (xCb+xB1+k, yCb+yB1+j)                    with i=0 . . . maxFilterLengthP−1 and j=0 . . .                    maxFilterLengthQ−1, the variables maxFilterLengthP,                    maxFilterLengthQ, and the variable t_(C) as inputs,                    and the filtered sample values p_(i)′ and q_(j)′ as                    outputs.                -   b. The filtered sample values p: with i=0 . . .                    maxFilterLengthP−1 replace the corresponding samples                    inside the sample array recPicture as follows:

recPicture[xCb+xB1+k][yCb+yB1−i−1]=p _(i)′

-   -   -   -   -   c. The filtered sample values q_(j)′ with j=0 . . .                    maxFilterLengthQ−1 replace the corresponding samples                    inside the sample array recPicture as follows:

recPicture[xCb+xB1+k][yCb+yB1+j]=q _(j)′

In one example, a filter process for a luma sample may be as follows:

-   -   Inputs to this process are:        -   the sample values p_(i) and q_(j) with i=0 . . . 3,        -   the locations of p_(i) and q_(i), (xP_(i), yP_(i)) and            (xQ_(i), yQ_(i)) with i=0 . . . 2,        -   a variable dE,        -   the variables dEp and dEq containing decisions to filter            samples p1 and q1, respectively,        -   a variable t_(C).    -   Outputs of this process are:        -   the number of filtered samples nDp and nDq,        -   the filtered sample values and q₁′ with i=0 . . . nDp−1, j=0            . . . nDq−1.            -   Depending on the value of dE, the following applies:        -   If the variable dE is equal to 2, nDp and nDq are both set            equal to 3 and the following strong filtering applies:

p ₀′=Clip3(p ₀−2*t _(C) ,p ₀+2*t _(C),(p ₂+2*p ₁+2*p ₀+2*q ₀ +q ₁+4)>>3)

p ₁′=Clip3(p ₁−2*t _(C) ,p ₁+2*t _(C),(p ₂ +p ₁ +p ₀ +q ₀+2)>>2)

p ₂′=Clip3(p ₂−2*t _(C) ,p ₂+2*t _(C),(2*p ₃+3*p ₂ +p ₁ +p ₀ +q ₀+4)>>3)

q ₀′=Clip3(q ₀−2*t _(C) ,q ₀+2*t _(C),(p ₁+2*p ₀+2*q ₀+2*q ₁ +q ₂+4)>>3)

q ₁′=Clip3(q ₁−2*t _(C) ,q ₁+2*t _(C),(p ₀ +q ₀ +q ₁ +q ₂+2)>>2)

q ₂′=Clip3(q ₂−2*t _(C) ,q ₂+2*t _(C),(p ₀ +q ₀ +q ₁+3*q ₂+2*q ₃+4)>>3)

-   -   -   Otherwise, nDp and nDq are set both equal to 0 and the            following weak filtering applies:            -   The following applies:

Δ=(9*(q ₀ −p ₀)−3*(q ₁ −p ₁)+8)>>4

-   -   -   -   When Abs(A) is less than t_(C)*10, the following ordered                steps apply:                -   The filtered sample values p₀′ and q₀′ are specified                    as follows:

Δ=Clip3(−t _(C) ,t _(C),Δ)

p ₀′=Clip1_(Y)(p ₀+Δ)

q ₀′=Clip1_(Y)(q ₀−Δ)

-   -   -   -   -   When dEp is equal to 1, the filtered sample value                    p₁′ is specified as follows:

Δp=Clip3(−(t _(C)>>1),t _(C)>>1,(((p ₂ +p ₀+1)>>1)−p ₁+Δ)>>1)

p ₁′=Clip1_(Y)(p ₁ +Δp)

-   -   -   -   -   When dEq is equal to 1, the filtered sample value                    q₁′ is specified as follows:

Δq=Clip3(−(t _(C)>>1),t _(C)>>1,(((q ₂ +q ₀+1)>>1)−q ₁−Δ)>>1)

q ₁′=Clip1_(Y)(q ₁ +Δq)

-   -   -   -   -   nDp is set equal to dEp+1 and nDq is set equal to                    dEq+1.

    -   When nDp is greater than 0 and one or more of the following        conditions are true, nDp is set equal to 0:        -   pcm_loop_filter_disabled_flag is equal to 1 and            pcm_flag[xP₀][yP₀] is equal to 1.        -   cu_transquant_bypass_flag of the coding unit that includes            the coding block containing the sample p₀ is equal to 1.

    -   When nDq is greater than 0 and one or more of the following        conditions are true, nDq is set equal to 0:        -   pcm_loop_filter_disabled_flag is equal to 1 and            pcm_flag[xQ₀][yQ₀] is equal to 1.        -   cu_transquant_bypass_flag of the coding unit that includes            the coding block containing the sample q₀ is equal to 1.

In one example, a filter process for a luma sample using long filtersmay be as follows:

-   -   Inputs to this process are:        -   the variables maxFilterLengthP and maxFilterLengthQ,        -   the sample values p_(i) and q_(j) with i=0 . . .            maxFilterLengthP and j=0 . . . maxFilterLengthQ,        -   the locations of p_(i) and q_(j), (xP_(i), yP_(i)) and            (xQ_(j), yQ_(j)) with i=0 . . . maxFilterLengthP−1 and j=0 .            . . maxFilterLengthQ−1,        -   a variable t_(C).    -   Outputs of this process are:        -   the filtered sample values and q; with i=0 . . .            maxFilterLengthP−1,    -   j=0 . . . maxFilterLengthQ−1.    -   The variables refMiddle, refP and refQ are derived as follows:    -   If maxFilterLengthP is equal to maxFilterLengthQ        -   If maxFilterLengthP is equal to 5

refMiddle=(p ₄ +p ₃+2*(p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂)+q ₃ +q ₄+8)>>4

Otherwise

refMiddle=(p ⁶⁻ +p ⁵⁻ +p ₄ +p ₃ +p ₂ +p ₁+2*(p ₀ +q ₀)+q ₁ +q ₂ +q ₃ +q₄ +q ₅ +q ₆+8)>>4

-   -   Otherwise If ((maxFilterLengthQ is equal to 7 and        maxFilterLengthP is equal to 5) or        -   (maxFilterLengthQ is equal to 5 and maxFilterLengthP is            equal to 7)

refMiddle=(p ₄ +p ₃+2*(p ₂ +p ₁ +p ₀ ++q ₁ +q ₂)+q ₃ +q ₄+8)>>4

-   -   Otherwise If ((maxFilterLengthQ is equal to 5 and        maxFilterLengthP is equal to 3) or        -   (maxFilterLengthQ is equal to 3 and maxFilterLengthP is            equal to 5)

refMiddle=(p ₃ +p ₂ +p ₁ +p ₀ +q ₀ +q ₁ +q ₂ +q ₃+4)>>3

-   -   Otherwise If ((maxFilterLengthQ is equal to 7 and        maxFilterLengthP is equal to 3)

refMiddle=(2*(p ₂ +p ₁ +p ₀ +q ₀)+p ₀ +p ₁ +q ₁ +q ₂ +q ₃ +q ₄ +q ₅ +q₆+8)>>4

Otherwise

refMiddle=(p ⁶⁻ +p ⁵⁻ +p ₄ +p ₃ +p ₂ +p ₁+2*(q ₂ +q ₁ +q ₀ +p ₀)+q ₀ +q₁+8)>>4

refP=(p _(maxFilterLengthP−) +p _(maxFilterLengthP-1−)+1)>>1

refQ=(q _(maxFilterLengthQ−) +q _(maxFilterLengthQ-1−)+1)>>1

-   -   The variables f_(i) and OD, are defined as follows:        -   If maxFilterLengthP is equal to 7

f _(0 . . . 6)={59,50,41,32,23,14,5}

t _(C) PD _(0 . . . 6)={6,5,4,3,2,1,1}

-   -   -   Otherwise if maxFilterLengthP is equal to 5

f _(0 . . . 4)={58,45,32,19,6}

t _(C) PD _(0 . . . 4)={6,5,4,3,2}

Otherwise

f _(0 . . . 2)={53,32,11}

t _(C) PD _(0 . . . 2)={6,4,2}

-   -   The variables g_(i) and t_(C)QD_(j) are defined as follows:        -   If maxFilterLengthQ is equal to 7

g _(0 . . . 6)={59,50,41,32,23,14,5}

t _(C) QD _(0 . . . 6)={6,5,4,3,2,1,1}

-   -   -   Otherwise if maxFilterLengthQ is equal to 5

g _(0 . . . 4)={58,45,32,19,6}

t _(C) QD _(0 . . . 4)={6,5,4,3,2}

Otherwise

g _(0 . . . 2)={53,32,11}

t _(C) QD _(0 . . . 2)={6,4,2}

p _(i)′=Clip3(p _(i)−(t _(C) *t _(C) PD _(i))>>1,p _(i)+(t _(C) *t _(C)PD _(i))>>1,(refMiddle*f _(i)+refP*(64−f _(i))+32)>>6)

q _(j)′=Clip3(q _(j)−(t _(C) *t _(C) QD _(j))>>1,q _(j)+(t _(C) *t _(C)QD _(j))>>1,(refMiddle*g _(j)+refP*(64−g _(j))+32)>>6)

-   -   where i=0 . . . maxLengthP−1 and j=0 . . . maxLengthQ−1

As described above, a tc offset (e.g., slice_tc_offset_div 2) is anoffset value that applies to the region of video data that includes aparticular sample. Further, JVET-L1001 provides where a tc offset,tcOffsetDiv2, is used to derive the indexTc, which is used for clippingoperations and for determining some thresholds. In one example,according to the techniques herein, tcOffsetDiv2, can be modified basedon the prediction mode. That is, according to the techniques herein tcoffsets tcOffsetDiv2_P and tcOffsetDiv2_Q may be derived. In oneexample, tcOffsetDiv2_P and tcOffsetDiv2_Q may be derived as follows:

tcOffsetDiv2_P=tcOffsetDiv2

tcOffsetDiv2_Q=tcOffsetDiv2

If the block at side P is intra,tcOffsetDiv2_P=tcOffsetDiv2_P−2

If the block at side P is intra,tcOffsetDiv2_Q=tcOffsetDiv2_Q−2

tcOffsetDiv2 is updated to (tcOffsetDiv2_P+tcOffsetDiv2_Q+1)>>1

-   -   Then the indexTc_P is derived by Clip3(0,        MAX_QP+DEFAULT_INTRA_TC_OFFSET,        (iQP+DEFAULT_INTRA_TC_OFFSET*(uiBs−1)+(tcOffsetDiv2_P<<1))) and        indexTc_Q is derived similarly.    -   Where,    -   iQP is the average of QPs at P-side and Q-side,    -   DEFAULT_INTRA_TC_OFFSET is a pre-defused max offset, and    -   uiBs is the boundary strength.

Further, as described above, a t_(C) value may be used as a clippingrange parameter and/or as a threshold value. Referring to the table inFIG. 6A, which is used to determine a t_(C) value, as described above,in one example, variables, iTc_P and iTc_Q may be used as a clippingrange parameter and/or as a threshold value on the samples at the P-sideand Q-side, respectively. In one example, iTc_P and iTc_Q are derived asfollows using iIndexTC_P and iIndexTC_Q indices to a table entry:

iTc_P=sm_tcTable[iIndexTC_P]*iBitdepthScale;

iTc_Q=sm_tcTable[iIndexTC_Q]*iBitdepthScale;

-   -   where,    -   sm_tcTable is the table illustrated in FIG. 6A; and,    -   iBitdepthScale is the bit depth scale. It is defined as        1<<(iInputBitdepth−8), where    -   iInputBitdepth is the input bit-depth of a sample.

As described above, in JEM a QTBT leaf node may be analogous to both aPB and a

TB in ITU-T H.265. That is, a CU corresponds to both a PU and a TU.JVET-L1001 provides the same basic partitioning structure as JEM,however, in JVET-L1001, a CU may be further partitioned into sub-blocks,including sub-blocks which are used for prediction and may be referredto as sub-PUs. Filters designed to deblock both sides of an edge, suchas, e.g., the filters in Table 1, filters may be classified as eitherbeing a long tap filter or a non-long tap filter with respect to eachside. For example, with respect to the filters in Table 1, in oneexample, the filter (s=7,t=3) may be classified as a P-side long tapfilter and as a Q-side non long tap filter. Similarly the filter(s=3,t=7) may be classified as a P-side non long tap filter and as aQ-side long tap filter and the (s=7,t=7) filter may be classified as aP-side long tap filter and as Q-side is long tap filter. When performingdeblocking on a boundary, a long tap filter may not be allowed for aside based on one or more of: a sub-block size associated with the side;a distance from an edge to the next parallel deblocking edge; CU sizeassociated with the side; TU size associated with the side; and/or a PUsize associated with the side.

Further, when sub-block boundaries are being deblocked and a long tapfilter is being employed, a long tap filter may cross sub-blockboundaries, which may result in overlap filtering. Overlap filtering mayblur textures and may affect parallelization. In one example, accordingto the techniques herein, a CU with sub-blocks may be treated as anon-large block. That is, in some cases, certain edges associated with ablock containing sub-blocks may not be deblocked. In one example, a longtap filter, which as described above, may, in some examples include afilter that modifies and/or has a filter support that includes at leastthree or more lines, can then only be used on the large block side. Itshould be noted that in other examples, with respect to sub-blocks, along tap filter may include any filter that modifies and/or has a filtersupport that crosses a sub-block boundary. Thus, a filter may bedisabled and/or modified anytime it modifies and/or has a filter supportthat crosses a sub-block boundary support.

In one example, in this case, the bSideQisLargeBlk and bSidePisLargeBlk,described herein, may be modified as follows:

-   -   If the block at P-side of the current boundary(CU boundary or        sub-PU boundary) makes use of sub-blocks, bSidePisLargeBlk is        set to false.    -   If the block at Q-side of the current boundary(CU boundary or        sub-PU boundary) makes use of sub-blocks, bSideQisLargeBlk is        set to false.

In one example, control logic dependent on the bSidePisLargeBlk andbSideQisLargeBlk may remain as provided above. In one example, for luma,if bSidePisLargeBlk is false, a long tap filter and large block logiccannot be used on the P-side and if bSideQisLargeBlk is false, a longtap filter and large block logic cannot be used on the Q-side. It shouldbe noted that although bSidePisLargeBlk and bSideQisLargeBlk aredescribed above with respect to the luma component, bSidePisLargeBlk andbSideQisLargeBlk may be similarly applied for a chroma component basedon the number of chroma samples in a block. Thus, in one example, forchroma, bSidePisLargeBlk is TRUE when P-side number of chroma samples isgreater than or equal to a threshold (e.g., 8, 16), Otherwise it isFALSE; and bSideQisLargeBlk is TRUE when Q-side number of chroma samplesis greater than or equal to a threshold (e.g. 8, 16), Otherwise it isFALSE. If bSidePisLargeBlk or bSideQisLargeBlk are false, a long tapfilter cannot be used on the current boundary.

In one example, according to the techniques herein, if the currenthorizontal boundary is a CTU boundary, and the block at the P-side(and/or Q-side) makes use of sub-PUs, the block at the P-side (and/orQ-side) may be treated as a small block (e.g., a large blockdetermination is set to false). Further, in one example, when a block istreated as a small block, padding may be used on a side where samplesspan another sub-block region.

In one example, one or more of the following rules may be used toprioritize filtering an outside sub-block edge over an inside sub-blockedge:

-   -   For N×N luma grid deblocking, when deblocking inside sub block        edges, if it is possible that the filter support includes        samples that may be deblocked by (parallel) outside sub block        edge deblocking, then do not deblock that edge using that        filter. For example, if the distance is less than a threshold        (e.g., 4, 8) for luma, then do not allow use of subset of        filters. In an example a subset of luma long filter e.g., subset        of {(s=7,t=7) (s=7,t=3) (s=3,t=7)} may not be allowed if their        filter support may include samples that may be deblocked. In an        example, HEVC strong filter HEVC_P, HEVC_Q may not be allowed if        their filter support may include samples that may be deblocked.    -   For N×N luma grid deblocking, when deblocking inside sub block        edges, if it is possible that the control decision process uses        samples that may be deblocked by (parallel) outside sub block        edge deblocking, then either alter the control process to not        make use of such samples or skip deblocking of the edge.    -   For N×N chroma grid deblocking, when deblocking inside sub block        edges, if it is possible that the filter support includes        samples that may be deblocked by (parallel) outside sub block        edge deblocking, then do not deblock that edge using that        filter. For example, if the distance is less than a threshold        (e.g., 4, 8) or chroma, then do not allow use of chroma long        filter e.g., HEVC_P, HEVC_Q, CL_P, CL_Q.    -   For N×N chroma grid deblocking, when deblocking inside sub block        edges, if it is possible that the control decision process uses        samples that may be deblocked by (parallel) outside sub block        edge deblocking, then either alter the control process to not        make use of such samples or skip deblocking of the edge.    -   For N×N luma grid deblocking, when deblocking inside sub block        edges, if it is possible that the deblocked samples (i.e.        samples that may change value) are included in filter support or        control process of the (parallel) outside edge, then do not        deblock that edge. For example, if the distance of inside sub        block edge from the parallel outside edge is less than a        threshold (e.g., 4, 8).    -   For N×N chroma grid deblocking, when deblocking inside sub block        edges, if it is possible that the deblocked samples (i.e.        samples that may change value) are included in filter support or        control process of the (parallel) outside edge, then do not        deblock that edge. For example, if the distance of inside sub        block edge from the parallel outside edge is less than a        threshold (e.g., 4, 8).

It should be noted that in the examples, above, in some examples, N maybe 4 or 8.

In one example, deblocking of sub block edges aligned with transformedges may be prioritized. For example, if a transform edge deblockingmay alter any of the samples that can be used in the filter supportand/or decision process of another (e.g., parallel) sub block edge, thenthe sub block edge is not deblocked (i.e., to enable parallelization).

Examples of a CU including sub blocks include the following: a 128×128CU including four 64×64 sub-PUs, a 128×64 CU including two 64×64sub-PUs, and a 64×128 CU including two 64×64 sub-PUs. As provided by theexample rules above, in some examples, sub-PU edges inside the CU mayinclude filter support or a control decision samples, that may bealtered by long filter, and as such, in some cases, these edges may notbe deblocked, even if they would otherwise align with a deblocking grid.

In one example, when transform coefficients are not present (e.g.,transform coefficients do not include any non-zero values) for a CUcontaining sub-PUs, CU is deblocked according to any of the techniquesprovided above for cases of a deblocking a CU containing sub-PUs, andwhen coefficients are present, the CU is deblocked as if the CU does notcontain sub-PUs.

It should be noted that according to the techniques herein, whendetermining the size of a CU for purposes of deblocking a sub-PU size(or other sub-block size) may be used instead. For example, whenconsidering the boundary between two 64×64 CUs, if one of the CUscontained 8×8 sub-PUs, the boundary may be considered as if there was a64×64 CU on one side and 8×8 CUs on the other side. Similarly, chromacomponents may be considered in a similar manner.

Referring again to FIG. 8, entropy encoding unit 218 receives quantizedtransform coefficients and predictive syntax data (i.e., intraprediction data and motion prediction data). It should be noted that insome examples, coefficient quantization unit 206 may perform a scan of amatrix including quantized transform coefficients before thecoefficients are output to entropy encoding unit 218. In other examples,entropy encoding unit 218 may perform a scan. Entropy encoding unit 218may be configured to perform entropy encoding according to one or moreof the techniques described herein. In this manner, video encoder 200represents an example of a device configured to receive an array ofsample values including adjacent reconstructed video blocks for acomponent of video data, and modifying sample values in the adjacentreconstructed video blocks according to multiple passes of a deblockingfilter.

Referring again to FIG. 7, data encapsulator 107 may receive encodedvideo data and generate a compliant bitstream, e.g., a sequence of NALunits according to a defined data structure. A device receiving acompliant bitstream can reproduce video data therefrom. Further, adevice receiving a compliant bitstream may perform a sub-bitstreamextraction process, where sub-bitstream extraction refers to a processwhere a device receiving a compliant bitstream forms a new compliantbitstream by discarding and/or modifying data in the received bitstream.It should be noted that the term conforming bitstream may be used inplace of the term compliant bitstream.

Referring again to FIG. 7, interface 108 may include any deviceconfigured to receive data generated by data encapsulator 107 andtransmit and/or store the data to a communications medium. Interface 108may include a network interface card, such as an Ethernet card, and mayinclude an optical transceiver, a radio frequency transceiver, or anyother type of device that can send and/or receive information. Further,interface 108 may include a computer system interface that may enable afile to be stored on a storage device. For example, interface 108 mayinclude a chipset supporting Peripheral Component Interconnect (PCI) andPeripheral Component Interconnect Express (PCIe) bus protocols,proprietary bus protocols, Universal Serial Bus (USB) protocols, I²C, orany other logical and physical structure that may be used tointerconnect peer devices.

Referring again to FIG. 7, destination device 120 includes interface122, data decapsulator 123, video decoder 124, and display 126.Interface 122 may include any device configured to receive data from acommunications medium. Interface 122 may include a network interfacecard, such as an Ethernet card, and may include an optical transceiver,a radio frequency transceiver, or any other type of device that canreceive and/or send information. Further, interface 122 may include acomputer system interface enabling a compliant video bitstream to beretrieved from a storage device. For example, interface 122 may includea chipset supporting PCI and PCIe bus protocols, proprietary busprotocols, USB protocols, I²C, or any other logical and physicalstructure that may be used to interconnect peer devices. Datadecapsulator 123 may be configured to receive and parse any of theexample parameter sets described herein.

Video decoder 124 may include any device configured to receive abitstream and/or acceptable variations thereof and reproduce video datatherefrom. Display 126 may include any device configured to displayvideo data. Display 126 may comprise one of a variety of display devicessuch as a liquid crystal display (LCD), a plasma display, an organiclight emitting diode (OLED) display, or another type of display. Display126 may include a High Definition display or an Ultra High Definitiondisplay. It should be noted that although in the example illustrated inFIG. 7, video decoder 124 is described as outputting data to display126, video decoder 124 may be configured to output video data to varioustypes of devices and/or sub-components thereof. For example, videodecoder 124 may be configured to output video data to any communicationmedium, as described herein.

FIG. 9 is a block diagram illustrating an example of a video decoderthat may be configured to decode video data according to one or moretechniques of this disclosure. In one example, video decoder 300 may beconfigured to decode transform data and reconstruct residual data fromtransform coefficients based on decoded transform data. Video decoder300 may be configured to perform intra prediction decoding and interprediction decoding and, as such, may be referred to as a hybriddecoder. In the example illustrated in FIG. 9, video decoder 300includes an entropy decoding unit 302, inverse quantization unit 304,inverse transform coefficient processing unit 306, intra predictionprocessing unit 308, inter prediction processing unit 310, summer 312,filter unit 314, and reference buffer 316. Video decoder 300 may beconfigured to decode video data in a manner consistent with a videocoding system. It should be noted that although example video decoder300 is illustrated as having distinct functional blocks, such anillustration is for descriptive purposes and does not limit videodecoder 300 and/or sub-components thereof to a particular hardware orsoftware architecture. Functions of video decoder 300 may be realizedusing any combination of hardware, firmware, and/or softwareimplementations.

As illustrated in FIG. 9, entropy decoding unit 302 receives an entropyencoded bitstream. Entropy decoding unit 302 may be configured to decodesyntax elements and quantized coefficients from the bitstream accordingto a process reciprocal to an entropy encoding process. Entropy decodingunit 302 may be configured to perform entropy decoding according any ofthe entropy coding techniques described above. Entropy decoding unit 802may determine values for syntax elements in an encoded bitstream in amanner consistent with a video coding standard. As illustrated in FIG.9, entropy decoding unit 302 may determine quantized coefficient valuesand predication data from a bitstream. In the example illustrated inFIG. 9, inverse quantization unit 304 receives quantized coefficientvalues and outputs transform coefficients. Inverse transform processingunit 306 receives transform coefficients and outputs reconstructedresidual data.

Referring again to FIG. 9, reconstructed residual data may be providedto summer 312. Summer 312 may add reconstructed residual data to apredictive video block and generate reconstructed video data. Apredictive video block may be determined according to a predictive videotechnique (i.e., intra prediction and inter frame prediction). Intraprediction processing unit 308 may be configured to receive intraprediction syntax elements and retrieve a predictive video block fromreference buffer 316. Reference buffer 316 may include a memory deviceconfigured to store one or more frames of video data. Intra predictionsyntax elements may identify an intra prediction mode, such as the intraprediction modes described above. Inter prediction processing unit 308may receive inter prediction syntax elements and generate motion vectorsto identify a prediction block in one or more reference frames stored inreference buffer 316. Inter prediction processing unit 310 may producemotion compensated blocks, possibly performing interpolation based oninterpolation filters. Identifiers for interpolation filters to be usedfor motion estimation with sub-pixel precision may be included in thesyntax elements. Inter prediction processing unit 310 may useinterpolation filters to calculate interpolated values for sub-integerpixels of a reference block.

Filter unit 314 may be configured to perform filtering on reconstructedvideo data. For example, filter unit 314 may be configured to performdeblocking and/or Sample Adaptive Offset (SAO) filtering, e.g., based onparameters specified in a bitstream. Further, it should be noted that insome examples, filter unit 314 may be configured to perform proprietarydiscretionary filtering (e.g., visual enhancements, such as, mosquitonoise reduction). Filter unit 314 may operate in a similar manner tofilter unit 216. As illustrated in FIG. 9, a reconstructed video blockmay be output by video decoder 300. In this manner, video decoder 300may be configured to receive an array of sample values includingadjacent reconstructed video blocks for a component of video data andmodify sample values in the adjacent reconstructed video blocksaccording to multiple passes of a deblocking filter.

In one or more examples, the functions described may be implemented inhardware, software, firmware, or any combination thereof. If implementedin software, the functions may be stored on or transmitted over as oneor more instructions or code on a computer-readable medium and executedby a hardware-based processing unit. Computer-readable media may includecomputer-readable storage media, which corresponds to a tangible mediumsuch as data storage media, or communication media including any mediumthat facilitates transfer of a computer program from one place toanother, e.g., according to a communication protocol. In this manner,computer-readable media generally may correspond to (1) tangiblecomputer-readable storage media which is non-transitory or (2) acommunication medium such as a signal or carrier wave. Data storagemedia may be any available media that can be accessed by one or morecomputers or one or more processors to retrieve instructions, codeand/or data structures for implementation of the techniques described inthis disclosure. A computer program product may include acomputer-readable medium.

By way of example, and not limitation, such computer-readable storagemedia can comprise RAM, ROM, EEPROM, CD-ROM or other optical diskstorage, magnetic disk storage, or other magnetic storage devices, flashmemory, or any other medium that can be used to store desired programcode in the form of instructions or data structures and that can beaccessed by a computer. Also, any connection is properly termed acomputer-readable medium. For example, if instructions are transmittedfrom a website, server, or other remote source using a coaxial cable,fiber optic cable, twisted pair, digital subscriber line (DSL), orwireless technologies such as infrared, radio, and microwave, then thecoaxial cable, fiber optic cable, twisted pair, DSL, or wirelesstechnologies such as infrared, radio, and microwave are included in thedefinition of medium. It should be understood, however, thatcomputer-readable storage media and data storage media do not includeconnections, carrier waves, signals, or other transitory media, but areinstead directed to non-transitory, tangible storage media. Disk anddisc, as used herein, includes compact disc (CD), laser disc, opticaldisc, digital versatile disc (DVD), floppy disk and Blu-ray disc wheredisks usually reproduce data magnetically, while discs reproduce dataoptically with lasers. Combinations of the above should also be includedwithin the scope of computer-readable media.

Instructions may be executed by one or more processors, such as one ormore digital signal processors (DSPs), general purpose microprocessors,application specific integrated circuits (ASICs), field programmablelogic arrays (FPGAs), or other equivalent integrated or discrete logiccircuitry. Accordingly, the term “processor,” as used herein may referto any of the foregoing structure or any other structure suitable forimplementation of the techniques described herein. In addition, in someaspects, the functionality described herein may be provided withindedicated hardware and/or software modules configured for encoding anddecoding, or incorporated in a combined codec. Also, the techniquescould be fully implemented in one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide varietyof devices or apparatuses, including a wireless handset, an integratedcircuit (IC) or a set of ICs (e.g., a chip set). Various components,modules, or units are described in this disclosure to emphasizefunctional aspects of devices configured to perform the disclosedtechniques, but do not necessarily require realization by differenthardware units. Rather, as described above, various units may becombined in a codec hardware unit or provided by a collection ofinteroperative hardware units, including one or more processors asdescribed above, in conjunction with suitable software and/or firmware.

Moreover, each functional block or various features of the base stationdevice and the terminal device used in each of the aforementionedembodiments may be implemented or executed by a circuitry, which istypically an integrated circuit or a plurality of integrated circuits.The circuitry designed to execute the functions described in the presentspecification may comprise a general-purpose processor, a digital signalprocessor (DSP), an application specific or general applicationintegrated circuit (ASIC), a field programmable gate array (FPGA), orother programmable logic devices, discrete gates or transistor logic, ora discrete hardware component, or a combination thereof. Thegeneral-purpose processor may be a microprocessor, or alternatively, theprocessor may be a conventional processor, a controller, amicrocontroller or a state machine. The general-purpose processor oreach circuit described above may be configured by a digital circuit ormay be configured by an analogue circuit. Further, when a technology ofmaking into an integrated circuit superseding integrated circuits at thepresent time appears due to advancement of a semiconductor technology,the integrated circuit by this technology is also able to be used.

Various examples have been described. These and other examples arewithin the scope of the following claims.

CROSS REFERENCE

This Nonprovisional application claims priority under 35 U.S.C. § 119 onprovisional Application No. 62/767,362 on Nov. 14, 2018, No. 62/790,917on Jan. 10, 2019, No. 62/793,844 on Jan. 17, 2019, the entire contentsof which are hereby incorporated by reference.

1. A method of filtering reconstructed video data, the methodcomprising: receiving an edge type variable specifying whether avertical edge or a horizontal edge is being filtered in a current blockof the video; deriving a maximum filter length based on the edge typevariable; and performing a deblocking filtering for the current blockbased on the derived maximum filter length. 2-4. (canceled)
 5. Themethod of claim 1, wherein deriving the maximum filter length furthercomprises deriving the maximum filter length based on one or moreconditions relating to at least one of a size of a transform blockassociated with the current block and a size of an adjacent transformblock.
 6. The method of claim 5, wherein the maximum filter length isset equal to 7 when (i) the edge type variable specifies that thehorizontal edge is filtered and (ii) a height in luma samples of thetransform block associated with the current block is equal to or greaterthan
 32. 7. The method of claim 6, wherein the maximum filter length isset equal to 3 when (i) the edge type variable specifies that thehorizontal edge is filtered and (ii) the height in luma samples of thetransform block is less than
 32. 8. The method of claim 5, wherein themaximum filter length is set equal to 3 when (i) the edge type variablespecifies that the horizontal edge is filtered and (ii) a first heightof the transform block at a chroma location in the current block and asecond height of the adjacent transform block are both equal to orgreater than
 8. 9. The method of claim 8, wherein the maximum filterlength is set equal to 1 when the edge type variable specifies that thehorizontal edge is filtered and at least one of (i) the first height ofthe transform block and (ii) the second height of the adjacent transformblock is less than
 8. 10. The method of claim 5, wherein the maximumfilter length is set equal to 7 when (i) the edge type variablespecifies that the vertical edge is filtered and (ii) a width in lumasamples of the transform block associated with the current block isequal to or greater than
 32. 11. The method of claim 10, wherein themaximum filter length is set equal to 3 when (i) the edge type variablespecifies that the vertical edge is filtered and (ii) a width in lumasamples of the transform block associated with the current block is lessthan
 32. 12. The method of claim 5, wherein the maximum filter length isset equal to 3 when (i) the edge type variable specifies that thevertical edge is filtered and (ii) a first width in chroma samples ofthe transform block at a chroma location in the current block and asecond width in chroma samples of the adjacent transform block are bothequal to or greater than
 8. 13. The method of claim 12, wherein themaximum filter length is set equal to 1 when the edge type variablespecifies that the vertical edge is filtered and at least one of (i) thefirst width in chroma samples of the transform block and (ii) the secondwidth in chroma samples of the adjacent transform block is less than 8.14. The method of claim 5, wherein the maximum filter length is setequal to 1 when (i) the edge type variable specifies that the horizontaledge is filtered and (ii) a modulo operation produces a particular valuewhen performed on a height of a coding tree block associated with theedge.
 15. The method of claim 5, wherein, when the edge type isvertical, the size of the current block comprises a width of thetransform block associated with the current block and the size of theadjacent transform block comprises a width of the adjacent transformblock.
 16. The method of claim 5, wherein, when the edge type ishorizontal, the size of the current block comprises a height of thetransform block associated with the current block and the size of theadjacent transform block comprises a height of the adjacent transformblock.
 17. The method of claim 1, wherein the maximum filter length isderived based on a color component variable specifying a particularcolor component value for the current block.
 18. The method of claim 1,wherein receiving an edge type variable comprises receiving a tree typevariable specifying whether a dual tree is used to partition video data,wherein deriving the maximum filter length comprises deriving themaximum filter length based on the tree type variable.
 19. The method ofclaim 1, wherein the maximum filter length for the current blockidentifies a maximum number of samples from the edge to modify whenperforming the deblocking, filtering for the current block.
 20. Themethod of claim 19, wherein the maximum number of samples in from theedge to use as inputs when performing the deblocking filtering for thecurrent block is derived from the maximum filter length.